Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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:

except-interface=enp1s0
dhcp-range=interface:wlp2s0,192.168.1.10,192.168.1.25,255.255.255.0,48h
dhcp-range=interface:enp0s29f7u4,192.168.2.10,192.168.2.25,255.255.255.0,48h

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

address=/name/192.168.1.1

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

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.

share|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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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