Score:1

dnsmasq: How to set alias domain / multiple DNS suffixes for local hostname resolution?

it flag

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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.