Advertisement

dhcp hostnames

Started by April 06, 2007 10:39 AM
3 comments, last by Gandalf01 17 years, 4 months ago
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

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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?
Advertisement

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....

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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

Stephen M. Webb
Professional Free Software Developer

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....

This topic is closed to new replies.

Advertisement