Setting a Blank DHCP Searchdomain on OpnSense

Super quick one because it took me way too long to google the answer…

How to tell Opnsense to not send through the searchdomain setting with DHCP – this stops it from interfering with domains that have no TLD (for people with funky LAN setups)

 

Problem: I use pihole for my network, I have my DHCP server telling the clients to use pihole for the DNS. But if I try to resolve something that has no TLD (eg. trying to resolve rin instead of rin.com) – it will instead try to resolve rin.localdomain.

If you suspect this is happening to you, on Windows or Mac, you can run the following:

nslookup
> set debug
> yourdomain

You’ll get a result like below, where it’s appending .localdomain or whatever domain your opnsense router has set in it.

If you look in the opnsense router settings under the DHCP server settings, you can either set it to blank, which will set it to the domain of the router, or you can enter a domain in there. You cannot enter “.” as a domain either.

Solution:

You have to set the DHCP server settings manually using their options, the options are

119 – Domain Search

15 – Domain

Set this under Additional Options as below:Hit Save and Reload the service, then renew your dhcp lease on the client.

Thanks to this Reddit post for the solution.

The real TLDR here though is don’t use TLD-less domain names, but I like them, so I will keep them. šŸ˜›

Leave a Reply