[Dnsmasq-discuss] reply /etc/hosts entry matching to interface

Joerg Habenicht j.habenicht at gmx.de
Thu Apr 6 16:28:57 BST 2006


Hello all,

isn't the option "localise-queries" used to return the matching address only?


At home I got a gateway with 3 interfaces ppp0, eth0, eth1
with 192.168.2.0/24 on eth0
  and 192.168.1.0/24 on eth1
with dnsmasq serving the DNS requests and listening on eth0 and eth1
(and lo)


The /etc/hosts looks like this:
# intern net:
192.168.2.1     minime.mydomain.lan        minime
...
# DMZ net:
192.168.1.1     minime.mydomain.lan        minime
192.168.1.2     jarrel.mydomain.lan        jarrel
...


so if I do a "host" call on jarrel I get:
$ host minime
minime.mydomain.lan has address 192.168.2.1

but I would like to get address 192.168.1.1 as an answer from dnsmasq
since returning 192.168.2.1 makes sshd nervous on jarrel.

Apr  6 13:10:57 jarrel sshd[6536]: Address 192.168.1.1 maps to 
minime.mydomain.lan, but this does not map back to the address - POSSIBLE 
BREAKIN ATTEMPT!



------------------------------------------

System is Linux, Kernel 2.6.15, Gentoo

I tested with dnsmasq version 2.22 and 2.27, no difference
tested with option "localise-queries" on and off, and only got 2 adresses or 
the wrong one.

Looked into the maillist archive, but got only people using multiple 
ip-adresses on the same interface
or using the same subnet over multiple interfaces.


Maybe the matching algorithm is to find the first entry of "minime" in the 
local database instead of the best matching?
I also had a look into the source of version 2.27 but didn't get far enough.



I'd like to get the adress 192.168.1.1 on my subnet XX.1.0 for querying 
"minime". Do you got a hint how to do this?

thanks in advance
Joerg




More information about the Dnsmasq-discuss mailing list