Configuring BIND DNS Server to Resolve Short Hostnames in a Private Network Domain


4 views

When setting up an internal DNS domain with BIND, one common requirement is the ability to resolve unqualified hostnames (like "office2") without requiring the full domain suffix ("office2.plumbnicoll.family"). This is particularly useful in mixed OS environments where different systems handle name resolution differently.

The solution lies in properly configuring the search domain parameter on client machines. While this isn't strictly a BIND configuration issue, there are supporting configurations we can implement on the DNS server side:

// Example named.conf options section
options {
    directory "/var/named";
    allow-query { localhost; 192.168.1.0/24; };
    recursion yes;
    listen-on { 192.168.1.1; };
    // Important for short name resolution:
    auth-nxdomain no;
    dnssec-enable no;
};

For Linux clients, edit /etc/resolv.conf:

search plumbnicoll.family
nameserver 192.168.1.1

For Windows clients, configure through Network Settings:

  1. Open Network Connections
  2. Select your active connection
  3. TCP/IPv4 Properties → Advanced → DNS
  4. Add "plumbnicoll.family" to DNS suffix list

You can also configure BIND to handle this through domain delegation. Create a zone file for the root domain (@):

// /var/named/plumbnicoll.family.zone
$TTL 86400
@       IN      SOA     ns1.plumbnicoll.family. admin.plumbnicoll.family. (
                        2023081501 ; Serial
                        3600       ; Refresh
                        1800       ; Retry
                        604800     ; Expire
                        86400      ; Minimum TTL
)

@       IN      NS      ns1.plumbnicoll.family.
@       IN      A       192.168.1.1

office2 IN      A       192.168.1.3
www     IN      CNAME   office2

Verify your setup with these commands:

# Check short name resolution
nslookup office2
dig office2

# Verify search domain is working
hostname -d

Watch out for these common issues:

  • Firewalls blocking DNS queries (UDP port 53)
  • Incorrect file permissions on zone files
  • Caching issues - use rndc reload after changes
  • Mixed case sensitivity in zone files

When setting up an internal DNS zone with BIND, administrators often encounter the limitation where clients must specify fully qualified domain names (FQDNs) like host1.example.com instead of just host1. This behavior differs from Windows DNS servers which automatically append the domain suffix.

To enable shortname resolution in BIND, we need to modify these key elements in named.conf or its included files:

options {
    directory "/var/named";
    listen-on { 192.168.1.1; };
    allow-query { 192.168.1.0/24; };
    recursion yes;
    search "plumbnicoll.family";
    domain "plumbnicoll.family";
};

The zone file (/var/named/plumbnicoll.family.zone) should include both forward and reverse mappings:

$TTL 86400
@   IN  SOA     ns1.plumbnicoll.family. admin.plumbnicoll.family. (
                2023081501  ; Serial
                3600        ; Refresh
                1800        ; Retry
                604800      ; Expire
                86400 )     ; Minimum TTL

    IN  NS      ns1.plumbnicoll.family.
    IN  MX  10  mail.plumbnicoll.family.

ns1             IN  A   192.168.1.1
office2         IN  A   192.168.1.3
laptop          IN  A   192.168.1.4
printer         IN  A   192.168.1.5

For Linux clients, ensure /etc/resolv.conf contains:

search plumbnicoll.family
nameserver 192.168.1.1

For Windows clients, the DNS suffix should be configured in network adapter properties:

  1. Open Network Connections
  2. Right-click adapter → Properties
  3. TCP/IPv4 → Properties → Advanced
  4. DNS tab → Append these DNS suffixes

Verify functionality with these commands:

# Linux/macOS
dig office2 +short
nslookup office2
host office2

# Windows
nslookup office2

For automatic client configuration, add these options to your DHCP server:

option domain-name "plumbnicoll.family";
option domain-name-servers 192.168.1.1;

If shortnames still don't resolve:

  • Check client DNS cache (ipconfig /flushdns on Windows)
  • Verify BIND logs (/var/log/messages or journalctl -u named)
  • Test with dig +trace office2.plumbnicoll.family
  • Ensure firewall allows DNS traffic (UDP/TCP 53)