Sign in to follow this  
swiftcoder

dhcp hostnames

Recommended Posts

I am running a lone OS X computer on my school CS lab full of unix machines (BSD, Mandriva, fedora, etc.). The network uses DCHP, and everything usually works fine. However, the network will not pick up/assign the hostname of my Mac, in fact, as far as the network is concerned, my Mac has no hostname at all. The system admin is as stumped as I am, and would be willing to fix the configuration if I can find a way to make it work. Can you suggest any way to make the Mac's hostname visible to the network? Everything else works, I can ssh into my machine via IP, etc. Thanks, Tristam

Share this post


Link to post
Share on other sites
The hostname will happen if and only if your computer registers itself with the DNS server. (Which is an entirely optional thing to do; it's very common for a computer which isn't accessed as a server to skip this, and have no hostname at all.) Not sure how to get OSX to do this for you....clicky?


EDIT: Actually, if you're using mDNS on the network, that's not what you need to do. Instead, you need to make sure you're getting and responding to multicasts appropriately. Is the subnet mask listed on your computer the same as the subnet mask listed on everyone else's computer, and is your computer in the same subnet as the others?

Share this post


Link to post
Share on other sites

Ok, problem solved!

After looking at the server logs, it turned out that my machine never actually sent my hostname to the server. Seems that OS X waits for the dchp server to give it an IP, and then requests a hostname. Problem is, standard linux dchp refuses the request, because it thinks my computer is trying to change its hostname.

So setting my hostname in /etc/hostconfig (add a line: HOSTNAME=myhostname) causes OS X to send the hostname out with the initial IP request, and everything works fine....

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
After looking at the server logs, it turned out that my machine never actually sent my hostname to the server. Seems that OS X waits for the dchp server to give it an IP, and then requests a hostname. Problem is, standard linux dchp refuses the request, because it thinks my computer is trying to change its hostname.

So setting my hostname in /etc/hostconfig (add a line: HOSTNAME=myhostname) causes OS X to send the hostname out with the initial IP request, and everything works fine....


Yes, that would be the RFC-compliant behaviour. The DHCP protocol only allows you to send your requested hostname when you request an IP address. It will likely ignore such a request at any other time. Also, it doesn't have to honour the hostname request (so that administrators can force a hostname on a particular machine). It's up to the DHCP server to dynamically update the DNS with the hostname.

--smw

Share this post


Link to post
Share on other sites
Hi,

I am so pleased to have found someone else who has had the problem with Mac hostnames not registering on the DNS server.

My particular enviroment has network with both Windows PCs running Win2K and Macs running OSX 10.3 and 10.4 and we had the problem wherby Mac hostnames were not registering on the DNS.
Would this also explain why I cannot ping a Mac by its hostname but can by its IP address ?

So I have an office of about 50 Macs, will I need to manually edit the config file for each Mac or is there a way to apply/run a script to force the registration of hostname to DNS/DHCP server ?

I want the hostname to match what we have entered in the Sharing PrefPane and the DHCP client field in OSX.

Any suggestions welcome and once again many thanks....

Share this post


Link to post
Share on other sites
Sign in to follow this