Dnsmasq - using several domain names to one ip

Could you please tell me, if it is possible to specify several domain names with one ip address in dnsmask?
In gui or cli.

For example

One way might be to place a file inside /tmp/dnsmasq.d/ with:

address=/example.com/aa.bb.cc.dd
address=/example2.com/aa.bb.cc.dd

And restart dnsmasq. I haven't tested that.

Pretty sure you can point multiple domains to the same IP, but you'd have to have a separate entry for each hostname.

1 Like

I use /etc/ethers and /etc/hosts in conjunction with dnsmasq. Here's an example:

Entry in /etc/ethers:

<MAC-address-of-client-interface> AZP-PC

Entry in /etc/hosts:

172.20.10.33	azp.home.lan	azp	mail.home.lan	mail	AZP-PC

The connection between /etc/ethers and /etc/hosts is the identifier AZP-PC

Now you can connect to 172.20.10.33 with the following names:

  • azp.home.lan
  • azp
  • mail.home.lan
  • mail
  • AZP-PC

When all changes are done, restart dnsmasq.

Good luck!

2 Likes

CNAMEs are supported in luci/ uci.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.