How to Configure Mac OS X Snow Leopard to Register Hostname with Windows DHCP Server for Network Resolution


30 views

When integrating a MacBook running Snow Leopard (10.6) into a Windows domain network, the DHCP hostname registration process differs from Windows machines. The key symptoms are:

  • DHCP leases show only IP addresses without hostnames
  • Windows workstations can't resolve the Mac via hostname (only by IP)
  • Traditional Windows-centric solutions don't apply
# 1. Set all naming parameters (execute sequentially)
sudo scutil --set HostName MACBOOK001
sudo scutil --set LocalHostName MACBOOK001
sudo scutil --set ComputerName "MACBOOK001"

# 2. Configure DHCP client options
sudo networksetup -setdhcp "Ethernet" -clientid "MACBOOK001"

Snow Leopard uses mDNSResponder for name resolution. Add this to /etc/hostconfig:

HOSTNAME=MACBOOK001

Then restart the service:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

For Windows clients to resolve the hostname:

  1. Ensure NetBIOS over TCP/IP is enabled in Network preferences
  2. Verify WINS server settings match your Windows domain
  3. Configure the smb.conf template if using Samba:
[global]
   netbios name = MACBOOK001
   workgroup = YOURDOMAIN
   wins server = x.x.x.x

Check registration from a Windows machine:

nbtstat -A [Mac_IP_Address]
ping MACBOOK001
nslookup MACBOOK001

If automatic registration fails, create a reservation on your DHCP server:

# Example for Windows DHCP server
Add-DhcpServerv4Reservation -ComputerName dhcp.yourdomain.com 
   -IPAddress 192.168.1.100 -ClientId (get-macaddress).Replace("-","") 
   -Name "MACBOOK001" -Description "Snow Leopard Laptop"
  • Packet capture shows DHCPREQUEST with blank Hostname field? Check mDNSResponder logs
  • Windows Event Viewer shows DNS registration failures? Verify DNS update permissions
  • MAC address differences between Wi-Fi and Ethernet? Use consistent interface

Many macOS users in Windows-dominated enterprise networks face this frustrating scenario: despite properly configuring all apparent hostname settings, the Mac won't register its name with the DHCP server. This creates connectivity issues where Windows machines can only reach the Mac via IP address, breaking many network workflows.

The root cause lies in how macOS handles DHCP requests differently from Windows. While Windows machines automatically send their NetBIOS names during DHCP negotiation, macOS requires additional configuration to achieve similar behavior in Active Directory environments.

Here's the complete step-by-step method to ensure proper hostname registration:

# 1. Set all naming parameters (run these in Terminal)
sudo scutil --set HostName MACBOOK001
sudo scutil --set LocalHostName MACBOOK001
sudo scutil --set ComputerName "MACBOOK001"

# 2. Create/edit the DHCP client configuration
sudo nano /etc/dhclient.conf

Add these lines to the dhclient.conf file:

send host-name "MACBOOK001";
send dhcp-client-identifier "MACBOOK001";
interface "en0" {
    send dhcp-client-identifier "MACBOOK001";
}

For Active Directory environments, we need to ensure proper DNS registration. Create this launchd plist file:

sudo nano /Library/LaunchDaemons/com.mydomain.dnsregistration.plist

With this content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.mydomain.dnsregistration</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/sbin/scutil</string>
        <string>--set</string>
        <string>HostName</string>
        <string>MACBOOK001</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

After implementing these changes:

# Release and renew DHCP lease
sudo dhclient -r
sudo dhclient

# Verify registration
nslookup MACBOOK001
dscacheutil -q host -a name MACBOOK001

If issues persist, check your Windows DHCP server logs for the registration attempt and verify that the DHCP server is configured to accept updates from non-Windows clients.

As a last resort, you can create a static reservation in your Windows DHCP server that permanently associates your Mac's MAC address with both an IP address and hostname. This bypasses the dynamic registration issue entirely.