How to make a Macintosh register a Hostname to the DHCP Server?

32,807

Solution 1

I'd say the problem is on the DHCP server end rather than your MacBook. The Windows DHCP server has a number of options for updating DNS records, and can behave a bit differently for clients that are or are not members of the domain. In the Windows 2003 version, there is a checkbox for updating clients that do not request updates (It mentions NT clients). From memory, I think that is what you will need to ensure is checked.

Solution 2

I am experiencing this same problem using MacOS X 10.7.2 (client) and Windows Server 2008 R2 (DHCP and DNS server). The Mac registers with DHCP fine, but cannot register its hostname.

Shortening the Mac's hostname seems to fix the problem. After some crude experiments, I have found that hostnames longer than 16 characters prevent the Mac from registering its hostname with DNS, while hostnames 16 or shorter work fine. This limit only applies to the machine hostname, not the FQDN.

So, try shortening your Mac's hostname to be 16 characters or less. Please post back if this works - I'd be interested to hear!

EDIT: Oh, and you'll also need Barryj's option set. Windows DHCP config > Rightclick the scope > Properties > DNS Tab > Enable all checkboxes and the bottom radio button

Solution 3

DNS hostname length per RFC is 64 characters (with 255 total for the FQDN). Microsoft NetBIOS name length is 16 characters (15 of the name plus 1 for a special class tag). What I've found is that, using a Windows-based DHCP/DNS infrastructure, you are automatically limited to a 15-char length even if you don't care about NetBIOS and even if your DNS hostname length is otherwise perfectly RFC compliant.

So static IPs can be whatever you want, since DNS will let you enter the long name. But dynamic/DHCP are limited to 15 if you want them to self-register in DNS.

I'm guessing that if you were to use a Unix/Linux back-end, you would not have this problem.

Solution 4

I discovered that Macs sometimes send their hostname in the request, and sometimes do not. In particular I found that if the computer name (Control Panel > Sharing -> Computer name) contains a space, then NO hostname will be sent (under OS X 10.6). If it does NOT contain a space, then it WILL be sent.

I compared the DHCP requests using tcpdump, with and without a space in the computer name.

With the computer name chris-macbook-space:

11:13:41.939462 IP (tos 0x0, ttl 255, id 36007, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:17:f2:xx:xx:xx, length 300, xid 0x9b57c74c, secs 1, Flags [none]
  Client-Ethernet-Address 00:17:f2:xx:xx:xx
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Discover
    Parameter-Request Option 55, length 10: 
      Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
      Option 119, LDAP, Option 252, Netbios-Name-Server
      Netbios-Node, Netbios-Scope
    MSZ Option 57, length 2: 1500
    Client-ID Option 61, length 7: ether 00:17:f2:xx:xx:xx
    Lease-Time Option 51, length 4: 7776000
    Hostname Option 12, length 19: "chris-macbook-space"

With the computer name chris-macbook space:

11:07:13.077664 IP (tos 0x0, ttl 255, id 36003, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:17:f2:xx:xx:xx, length 300, xid 0x432cbbda, secs 2, Flags [none]
  Client-Ethernet-Address 00:17:f2:xx:xx:xx
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Discover
    Parameter-Request Option 55, length 10: 
      Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
      Option 119, LDAP, Option 252, Netbios-Name-Server
      Netbios-Node, Netbios-Scope
    MSZ Option 57, length 2: 1500
    Client-ID Option 61, length 7: ether 00:17:f2:xx:xx:xx
    Lease-Time Option 51, length 4: 7776000

Note the missing Hostname Option 12, length 19: "chris-macbook-space" in the latter case.

So you could try removing spaces and any other special characters from the computer name, to see if that enables it to be resolved on the network.

Solution 5

First, you are trying to register it to the DNS server, which handles resolution. You may be looking in the wrong area for settings to change.

Search DNS on the first document, and see if any of their suggestions help you. I also included a couple others, which looked helpful. There are known bugs, so there might not be a simple answer without troubleshooting, and knowing specifics about your local domain.

http://www.macwindows.com/snowleopardAD.html http://hintsforums.macworld.com/showthread.php?t=104825 http://www.applesource.com.au/how-to/soa/Connect-a-Mac-to-Windows-Small-Business-Server/0,2000451082,339287478,00.htm

Share:
32,807

Related videos on Youtube

netmikey
Author by

netmikey

Updated on September 18, 2022

Comments

  • netmikey
    netmikey over 1 year

    I have a MacBook running Snow Leopard in our company's internal network, which is basically a Windows domain network. Our TO department complains about my MacBook not specifying a name to the DHCP server. Accordingly, the MacBook isn't resolvable by anything else than its IP address from our Windows workstations.

    I already

    • set the NetBIOS name in the Network settings in the OSX Control Panel
    • set the DHCP Client ID in the Network settings in the OSX Control Panel
    • set the "Computer Name" in Control Panel > Sharing.
    • set the hostname using sudo scutil --set HostName MACBOOK001 (and rebooted)

    ... but all of that didn't solve the problem.

    Can anyone tell me how to make OSX register its hostname to the DHCP server so that it can be reachable e.g. using ping MACBOOK001

  • KCotreau
    KCotreau almost 13 years
    GREAT point. Although I mentioned that what he was describing was actually DNS-related, there is that checkbox in the DHCP server configuration, and it is not checked by default.
  • KCotreau
    KCotreau almost 13 years
    See barryj's comment and ask your Windows administrator to make sure that box is checked, and that he restarts the service after checking it.
  • RusNewman
    RusNewman over 12 years
    Oh, and you'll also need Barryj's option set. Windows DHCP config > Rightclick the scope > Properties > DNS Tab > Enable all checkboxes and the bottom radio button.
  • netmikey
    netmikey over 11 years
    Unfortunately, I'm afraid I won't be able to definitely validate any answer since I don't have the slightest access or even influence over the windows server configuration here. I can, hoever, tell you that the hostname has been ABCD_MACBOOK1 (13 chars) the whole time, so although your answer might be part of a solution, it doesn't seem to be the one single solution by itself. Still, your help is much appreciated!
  • starfry
    starfry about 11 years
    I've been experience similar problems and found that it's the "computer name" that causes the problem. The OS setup sets this to something like "fred's macbook". I found that changing it to "myhost" fixed the problem (see also serverfault.com/questions/486269)
  • user165568
    user165568 over 10 years
    It is unusual to allow random hosts to change DNS settings. You normally need to be authenticated to do that. What happens on some routers, including Windows Servers if set that way, is that DHCP clients are are automatically added to DNS, using authentication credentials from the DHCP server.