Is it possible to set multiple search domains via dnsmasq/DHCP? Due to some migration, I need multiple clients to be able to:
ping server.old-domain
ping server.new-domain
# both should work, .old-domain being an alias for .new-domain
I have tried the following:
dhcp-option=option:domain-search
- only works for dhcpcd, which I cannot solely rely on
- same link also suggests
dhcp-option=15,".old-domain .new-domain"
(note the space) - seems rather to be a hack
- regex domain pattern (is this by now possible?) - didn't work for me
- setting
domain=old-domain,new-domain
in /etc/dnsmasq
lead to syntax error with dnsmasq --test
- if multiple
domain
entries, the last read is taken
cname
seems to be rather for single host names, imo no wildcard possible
There are multiple scripts using the old domain name, hence a domain alias would ease up gradual migration. Have I forgotten an alternative or isn't this possible?
/etc/dnsmasq.conf
:
domain-needed
bogus-priv
local=/new-domain/
bind-interfaces
expand-hosts
domain=new-domain
dhcp-range=...
dhcp-option=option:router,...
dhcp-option=option:dns-server,...
dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
dhcp-authoritative