[Dnsmasq-discuss] Set outgoing IP-Address to dns-upstream-servers

Simon Kelley simon at thekelleys.org.uk
Fri Mar 6 16:00:33 GMT 2009


Michael Rack wrote:
> Hi List, Hi Simon!
> 
> Is it able to tell DNSMASQ to use an fixed ip-address to contact 
> dns-upstream-servers that defined in /etc/resolv.conf ?
> 
> My system is multihomed and in my current situation DNSMASQ uses the 
> ip-address of my default-routes device.
> 
> On the documentation (MANPAGE) there is a option --query-port= but this 
> is not for use to define the query-ip-address.

You can't set this when the upstream servers are in /etc/resolv.conf 
(the format of the file is not defined by dnsmasq, and doesn't have a 
way of specifying the information.)


If you can move the upstream nameserver addresses into 
/etc/dnsmasq.conf, it's easy:

server=<address of server>@<local address to talk through>


So if your server is at 1.2.3.4 and the machine running dnsmasq has an 
interface whose address is 5.6.7.8 which you want to use to talk to the 
server

server=1.2.3.4 at 5.6.7.8

will do the trick.


HTH

Simon.




More information about the Dnsmasq-discuss mailing list