[Last Call] Learn how to a build a cloud-first strategyRegister Now


Random hostname assigned to Mac on AD Network (WINS/DHCP/DNS on W2k3 Server)

Posted on 2008-11-05
Medium Priority
Last Modified: 2013-11-25
My environment is a Windows 2003 AD network where I run DHCP/DNS/WINS all on the DCs of the AD network.  It's a small network and there are only 2 DCs running those services.  
The problem is more of an annoyance and hasn't caused any problems yet.  
On the Mac...
In Sharing Preferences the computer name was incorrect.  I clicked edit, and gave it the name I wanted and it sticks after reboot.  
In Network Preferences - advanced I went into the WINS Settings and entered the NetBIOS name the same as in the sharing preferences, this setting sticks also.  
Both settings that I changed above were originally hostnames of other computers on the network, before I specified one, it would get a different hostname every time it would get a new IP address.  After specifying for both, they stuck.  The only problem now is that when I go into the terminal console, the prompt is another hostname on the network.  I issue the hostname command and sure enough it's got the wrong hostname, it is a valid hostname on the network but that machine (laptop) is offsite, ie not connected.  I can SU and change the hostname (hostname -s newhostname), and that sticks until I reboot, then it reverts.  
I can ping from my windows machine the netbios name of the Mac and it replies properly.  When I try to ping -a the IP of the Mac, it resolves to the incorrect hostname I see in the terminal prompt of the Mac.  

Initial thoughts are that DHCP issues Wins Server info as part of the scope, and Wins might have this hostname still listed in its DB.  I'm not sure though since I don't know much about Wins.

The Mac is not bound to the AD network at all; except for using the AD DHCP/DNS/Wins services.  

Has anyone ever  seen this behaviour before?  

Question by:wv-rog
  • 3
  • 2

Expert Comment

ID: 22892157

Let me get this right.  
You, (through DHCP Option) issue a host name to a client computer? If not than DHCP _should_ accept the hostname the computer has chosen, and lob it into the AD DNS for lookups.

By default the shared name is "Someones' Mac"  not "hostname or hostname.domain.com"
You changed it to say "hostname"
when you use hostname -s "someother" as root or under sudo.

You reboot the box and you get back "hostname.domain.com" not "newhostname.domain.com"

Just use the Sharing tab to set it. Also if check your DHCP server and make sure it honors the client set hostname. This is why you were getting random assignments.

After DHCP giving you an address, OSX would check reverse DNS and auto-set the hostname for you.


Accepted Solution

DJDecay earned 375 total points
ID: 22892169
you may also want to check


Check this thread on apple forums.

"Hostnames under Leopard"

Author Comment

ID: 22897130
I changed the hostname in the sharing preferences and it sticks.  it's the terminal prompt that is wrong.  The SUDO hostname -s 'someother' works for that session, but not when I reboot.  
"After DHCP giving you an address, OSX would check reverse DNS and auto-set the hostname for you."
That might be the key because for some reason the DHCP server is not updating the DNS server with it's leases for non-domain member work stations.  I'll look into it.  

I'll also check out the Apple link you sent.  I'll get back to you in a few hours.  Thanks for the tips.  


Author Comment

ID: 22900275
So the update to the hostconfig file with the hostname=desiredhostname line seems to do the trick.  Even though it says at the top of that file "This file is going away" it does seem to work like the posting you linked to said.  

In regards to your first comment on this topic, I do not issue the hostname out to clients from the DHCP server.  I don't know how i would force that anyway.  It looks like my AD DNS is not getting updated at all with any non-domain member computers' A records.  Strange, despite the fact that I have configured dynamic updates to the DNS server (same machine).  I still think the problem lies in WINS because that's the only place where the incorrect hostname appeared, i.e. no active leases in DHCP nor any A records in DNS.  Different issue all together.  

Thanks for the response, your second one seemed to do the trick, so... points awarded.  


Author Closing Comment

ID: 31513748

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article outlines the struggles that Macs encounter in Windows-dominated workplace environments – and what Mac users can do to improve their network connectivity and remain productive.
This is a tech scam I recently helped my parents through.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question