Linux

Multiple DNS Search Suffixes in dhcpd.conf

So this a quick post because I spent a few hours resolving this issue and wanted to share. The DHCP option domain-search (code 119) is used to specify the DNS domain search list (i.e. “search example.com sales.example.com marketing.example.com” in /etc/resolv.conf) but it’s not clearly stated the format for dhcpd.conf. After trying many different combinations I finally nailed it down:

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.101 192.168.1.199;
    option domain-name "example.com";
    option domain-search "example.com", "sales.example.com", "marketing.example.com";
    option domain-name-servers 192.168.1.1;
    option routers 192.168.1.1;
}

So the format is: option domain-search “SUFFIX 1”, “SUFFIX 2”, …, “SUFFIX N”;

Cheers,
–The IT Department

6 thoughts on “Multiple DNS Search Suffixes in dhcpd.conf

  1. On a related note, if you’re trying to supersede this setting in your dhclient.conf, so that you end up with multiple domain-search entries that supersede the ones handed out by the dhcp server, the client-side syntax is different:

    supersede domain-search “example.com example.net”;

Leave a comment