Dnsmasq: customize search domain

Hi,

I thought the subject had already been addressed but I cannot find the answer…

I am trying to customize the search domain provided by the DHCP server (dnsmasq). I am ok for the DHCP to provides hostnames in .lan but I wan’t the search domain to be internal.myowndomain.com.

I have tried to set the domain option to internal.myowndomain.com but it does not seems to change anything.

Is this possible?

In Foris DNS tab you can choose your own “Domain of DHCP clients in DNS” instead of the default “lan”.

Yes but this would stop providing hostnames in .lan? I only want the search domain to change.

This changes the names served in DNS from foo.lan. to foo.your.custom.suffix.

When you mention “search domain”, that’s something a client does, e.g. the search command in /etc/resolv.conf (on Linux/glibc systems at least, not sure where else) – in some conditions it tries to append the suffix “locally”.

after Foris i had to aslo check /etc/config/resolver common section

    option static_domains '0'  ## manually added
    option dynamic_domains '1' ## added by Foris

Otherwise resolving was not working correctly (in my case).

Yes and I do not want to change this.

Indeed. But is this option not set accordingly to what is provided by the DHCP?

I have Unbound resolver configured on the Turris with stub-zone served by NSD. The NSD zone contains LAN hosts. This is why I am not talking about DNS but only DHCP.

I see. I don’t know it that’s possible with DHCP.

OK. It is indeed working with the domain option (leaving local untouched). The error was on the client side, I was missing the UseDomains=true on systemd-networkd conf.

1 Like