[Dnsmasq-discuss] Feature request: name--to-IP answer depending on IP-address of client

Simon Kelley simon at thekelleys.org.uk
Wed Jun 7 17:06:28 BST 2006


Илья Евсеев wrote:
>    Hi, Simon and all folks!
> dnsmasq provides "localise-query" that returns name-to-IP resolution depending on IP-address of NIC that receives the request.
> 
> This feature works very well except situations
> when single NIC serves multiple IP's using IP-aliases.
> 
> In that situations DNS-server should translate names
> using IP-address of requestor.
> 
> Consider following example (under FreeBSD):
> ifconfig xl0 192.168.1.1 netmask 255.255.255.0
> ifconfig xl0 217.170.93.1 netmask 255.255.255.0 alias
> 
> /etc/hosts:
> 192.168.1.1  vpn
> 217.170.93.1 vpn
> 
> Expected result:
> Client 217.170.93.100 on xl0 interface requests translation of "vpn"
> and receives "217.170.93.1" as the answer.
> Client 192.168.1.100 on the same interface requests translation of "vpn"
> and receives "192.168.1.1".
> 
> WBR, Ilya
> 

localise-query should work on the address that the query is send to, 
_not_ the IP of the NIC that received the packet, so in your case, if
client 217.170.93.100  has 217.170.93.1 in /etc/resolv.conf then it 
should get 217.170.93.1 for VPN, whilst 192.168.1.100 has 192.168.1.1 in 
/etc/resolv.conf and gets 192.168.1.1 for vpn.

Have you tried that? I'm pretty sure it works that way on Linux, but 
this all depends on the nasty, system-specific details of the networking 
API, so it might be broken under FreeBSD.

I'm aware, for instance that this won't work on OpenBSD, and it won't 
work with the --bind-interfaces flag.

Cheers,

Simon.





More information about the Dnsmasq-discuss mailing list