4

I would like to have the DHCP server in my Unifi Security Gatway include multiple domain search entries as part of DHCP option 119 so that I can use shortnames for multiple suffixes like:

  • host -> host.example.com
  • anotherhost -> anotherhost.home.arpa
  • container -> container.somehost.lxd

Currently the Domain Name: example.com entry in the Network settings is used for the option domain-search "example.com" entry in /opt/vyatta/etc/dhcpd.conf, but this field does not allow you to specify multiple entries (probably for good reason).

I attempted to enable a custom DHCP option for Code 119, but this seems to use a raw hex value in the config file like option domain-search 65:78:61:6d:70:6c:65:2e:63:6f:6d:20:68:6f:6d:65:2e:61:72:70:61; for a value of "example.com home.arpa". It also doesn't clear the original entry, which likely causes issues with how the values get encoded on the wire. I tried various values but none seem to show up correctly in /var/lib/dhcp/dhclient.leases

How can I configure multiple search suffixes for my Unifi network?

Greg Bray
  • 5,530
  • 5
  • 33
  • 52

2 Answers2

3

I know that this is quite old, however using the text type as a custom DHCP option didn't work for me. I needed to add a custom code 119 of type hex array and convert the search list to hex. I wrote a simple python script to convert the domain list and just adding the output from that script worked like a charm for me.

Barre
  • 31
  • 3
  • I googled around a lot and this answer is what finally worked for me. Using USG-3P firmware version 4.4.56 and Unifi controller version 7.0.23. – Moduspwnens Apr 07 '22 at 13:02
1

I'm sure you've figured this out by now, but you can set a "text" type for a custom DHCP option, then just enter a comma separated domain list. Note: it overrides the default provided by the DHCP server, so you need to include that too.

jturle
  • 11
  • 1