Apple OS X & DNS: Why do Macs steal DNS names?
Can anyone help me better understand why Macs commonly show up with the FQDN's of other machines in our organization? Example Scenario Below.
I used to think it was a problem with the way IP address leases we conveyed, but Macs will also steal FQDNs from other subnets, so I guess it isn't that simple.
I'm still fuzzy on all the intricate details of DNS and how respective platforms deal with it. Any direction or advice is much appreciated!
Example Scenario:
- Apple OS X 10.5.8 bound to AD (2003)
- I'm manually installing Kaseya agents on a cart of laptops.
The first one installs and shows up in Kaseya's agent list with the correct name. e.g. BHS-C11-01. BHS-C11-01 is the name in the "Computer Name:" field of the Sharing pane in System Prefences. The machine was bound to AD with the name BHS-Floater-0232.
The second one installs and shows up in Kaseya's agent list as KES-RM19, which is neither the name displayed in the Sharing pane of System Preferences nor the name the computer was bound to AD with. KES-RM19 is a PC computer in an entirely different building, on an entirely different subnet.
This phenomenon has also been causing problems with ARD administration for years. A machine will flip back and forth between two DNS names with such frequency that you cannot reliable schedule tasks.
I could go on and on, but I think I'll stop here and wait for questions if anyone is interested.
Edit: OK, so I did discover that the hostname which I was assuming was from another subnet actually isn't. The owner of that computer has an account listed as being in my building after all, the hostname of hsi/her computer just wasn't changed when they moved. (which is no surprise)
Posted Dec 1, 2011, 4:58 PM UTC · edited
By default, when a Windows computer is assigned a DHCP address, it sends a DNS registration request to its DNS server, which registers an A and a PTR record for it. These dynamic DNS records do not expire when the lease expires; they stick around waiting for DNS scavenging to kick in.
The best information I could find regarding the method that OS X sets its hostname has this to say:
If your PTR records are not being cleaned up before the lease expires, it's possible for a Mac to grab that IP address via DHCP while the PTR record is still active, thus causing it to take the hostname of the Windows machine that previously leased the address.
I would look into the HOSTNAME option in /etc/hostconfig to see what options you have. Unfortunately, the default configuration seems to be pretty junky and DNS scavenging is just a royal pain in the ass to get set up just right.
I am not an expert on Macs but with nix type non MS dns servers I believe they generally don't allow the clients themselves to update the dns for security reasons, instead the dhcp server is setup with a key and the permissions to update dns when it gives out a lease.
I remember somewhere there's an option for having the dhcp server update dns for specific clients, generally for older clients that can't do it themselves, but that might work for the non windows computers on your network.
MS DNS servers actually function pretty similar to Bind in this case, requiring secure updates by default; it's the clients that differ by updating DNS on their own rather than leaving it to the DHCP server.
You can configure the DHCP server to force it to perform DNS updates at multiple levels. Get properties on a scope or a reservation, then click the DNS tab and there are two options here that do the job.
I don't understand why they had their clients update DNS directly, because it removes a lot of centralized control from the situation. A DHCP server knows when the lease expires and can delete the DNS records accordingly. The client isn't going to be on the network to do the same job.