How to Configure Windows Server 2008 DHCP/DNS to Register A Records for Non-Domain Linux (Ubuntu) Clients


32 views

When integrating Linux machines into a Windows-dominated network infrastructure, one persistent pain point is getting proper DNS registration. Unlike Windows clients that automatically register with AD-integrated DNS, Linux boxes require explicit configuration on both client and server sides.

DNS registration can occur through two paths:

1. Server-side registration (DHCP updates DNS)
2. Client-side registration (via nsupdate or similar tools)

For Windows Server 2008 environments, we want the DHCP server to handle registration since we're not joining the Linux machines to the domain.

On your Windows 2008 server:

  1. Open DHCP Manager
  2. Right-click your IPv4 scope → Properties
  3. Navigate to DNS tab
  4. Enable these options:
    [X] Enable DNS dynamic updates according to the settings below
    [X] Always dynamically update DNS records
    [ ] Discard A and PTR records when lease is deleted

Modify /etc/dhcp/dhclient.conf:

send host-name "ubuntubox";
send fqdn.fqdn "ubuntubox.mydomain.local";
send fqdn.encoded on;
send fqdn.server-update on;
request subnet-mask, domain-name-servers, domain-name, host-name;

The dual /etc/dhcp and /etc/dhcp3 directories stem from Ubuntu's transition between DHCP implementations. Modern systems should use /etc/dhcp.

To force registration:

sudo dhclient -r  # Release current lease
sudo dhclient  # Obtain new lease

Verify with:

hostnamectl set-hostname ubuntubox.mydomain.local
systemctl restart systemd-hostnamed

If DHCP registration fails, use nsupdate:

nsupdate -k /etc/bind/rndc.key
> update add ubuntubox.mydomain.local 3600 A 192.168.1.100
> send
> quit

Integrating Linux machines into a predominantly Windows-based network infrastructure poses specific DNS registration challenges. The key issue isn't whether the registration is performed by the Linux client or Windows DHCP server - both methods should work when properly configured.

For Ubuntu 11.04 systems, the correct configuration file is indeed /etc/dhcp/dhclient.conf. The /etc/dhcp3 directory is a legacy artifact from earlier Debian/Ubuntu versions. Here's the optimal configuration:

send host-name "ubuntubox";
send fqdn.fqdn "ubuntubox.mydomain.local";
send fqdn.encoded on;
send fqdn.server-update on;
option fqdn.no-client-update on;

The DHCP server requires these specific settings:

  1. Open DHCP Manager → Right-click IPv4 → Properties → DNS tab
  2. Enable "Always dynamically update DNS A and PTR records"
  3. Check "Dynamically update DNS records for DHCP clients that do not request updates"
  4. Enable "Discard A and PTR records when lease is deleted"

Always use FQDN (Fully Qualified Domain Name) format for hostname registration. Both of these are technically correct, but have different implications:

send host-name "ubuntubox";           # Short name
send host-name "ubuntubox.mydomain.local"; # FQDN

The FQDN format is preferred as it ensures proper DNS resolution across different network segments.

The complete DHCP lease management sequence on Linux should be:

sudo dhclient -r      # Release current lease
sudo dhclient -v      # Obtain new lease with verbose output
sudo systemd-resolve --flush-caches  # Clear local DNS cache

When debugging DNS registration issues:

# Check DHCP client logs
journalctl -u systemd-networkd -u systemd-resolved

# Verify DHCP options
dhclient -1 -v -d eth0

# Check DNS registration
nslookup ubuntubox.mydomain.local
dig +short ubuntubox.mydomain.local

For environments requiring strict control, consider these additional measures:

# /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
    up sleep 5; /sbin/dhclient -r -v eth0
    up sleep 2; /sbin/dhclient -v eth0