I have a self-made Linux router running dnsmasq. It has two different NICs through which clients are connected; one of them has the subnet 192.168.1. and one the subnet 192.168.2.. My /etc/dnsmasq.conf looks like this:


Resolving the clients works between subnets, but from neither subnet can I resolve the hostname of the server itself. If I add a static rule using address=/name/IP I have to choose on of the subnets and pinging (among other things) does not work from the other subnet. So for example if I set


then I can resolve the hostname from the 192.168.2. subnet, but pings are unanswered. How do I solve that situation? I would like not having to bridge the interfaces or something like this.


As I understand, in your case, the server have an address for each subnet: and the other could be

I guess you want the clients to receive the server address of its corresponding subnet.

I had the same problem, found answer in http://t7994.network-dns-dnsmasq-general.dnstalk.us/multi-homed-server-with-same-hostname-on-2-subnets-t7994.html

Check "-y, --localise-queries" in the dnsmasq man page.

You can put "localise-queries" in dnsmasq.conf too, and put the two server address entries the /etc/hosts file.

| improve this answer | |
  • perfect! This is exactly what I was looking for. – janoliver Oct 10 '13 at 7:29
  • Btw: This also works when putting the line localise-queries into dnsmasq.conf. – janoliver Oct 18 '13 at 6:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.