[Dnsmasq-discuss] Multiple resolv.conf files ...
Clinton Lee Taylor
clintonlee.taylor at gmail.com
Wed Oct 14 13:27:09 BST 2009
Thanks for the quick responce ...
>>>> Been looking into creating a Linux Router that can be used for
>>>> internet connection fall over, when the primary internet connection
>>>> fails, I would like to have the router switch to the backup. I know
>>>> that DnsMasq can't really help with this, but, I'm looking at making a
>>>> second connection, using 3G ...
>>>> So, my problem is that without making very complicated scripts, could
>>>> we not make DnsMasq be able to read multiple resolv.conf type files
>>> Simon already has this covered, read your man page, which says
>>> "Dnsmasq can be told to poll more than one resolv.conf file".
>> Arh, yes ... I did see this and hoped that it would work similar to
>> other multiple options ...
>> Went through that, but I did not get it to work as I had hoped ...
>>> You'll solve your problem a lot faster than waiting for an answer from
>>> the list.
>> Mmm, right and wrong ... If you read the little bit before, I was
>> hoping that I could read multiple resolv.conf type files, but testing
>> showed something that did not seem to be working as I had expected ...
>> Was hoping that either what I was epxecting, could be helped or maybe
>> another insight into another way to do a similar thing ...
>>>> The reason I would like this, is that each internet facing interface,
>>>> using something like DHCP, would have their own DNS server list that I
>>>> could get DnsMasq to read/use, so that DNS queries would be sent down
>>>> each active internet interface ...
>> I added to my dnsmasq.conf file two lines as follows ...
>> But when I restart dnsmasq, it only list the last resolv.conf file
>> and the dns server there in ... Do I need to use the -r option from
>> the command line ( init script ) or can this option be used in the
>> dnsmasq.conf file?
>> Oct 14 12:49:30 hermes dnsmasq: exiting on receipt of SIGTERM
>> Oct 14 12:49:30 hermes dnsmasq: started, version 2.45 cachesize 150
>> Oct 14 12:49:30 hermes dnsmasq: compile time options: IPv6
>> GNU-getopt no-ISC-leasefile no-DBus no-I18N TFTP
>> Oct 14 12:49:30 hermes dnsmasq: DHCP, IP range 192.168.1.65 --
>> 192.168.1.115, lease time 4h
>> Oct 14 12:49:30 hermes dnsmasq: reading /etc/resolv.conf.dnsmasq-3g
>> Oct 14 12:49:30 hermes dnsmasq: using nameserver 22.214.171.124#53
>> Oct 14 12:49:30 hermes dnsmasq: read /etc/hosts - 8 addresses
> Dnsmasq checks the modification times of both (all) the files, and uses the
> one that was changed last. Try this:
> touch /etc/resolv.conf.dnsmasq-eth0
> dig www.google.com
Arh! Okay, when I was restarting dnsmasq, I was only seeing the
changes of the last file ...
> You should see dnsmasq read the eth0 file and start to use the nameservers
> in there.
Oct 14 13:38:38 neuropeptide dnsmasq: reading /etc/resolv.conf.dnsmasq
Oct 14 13:38:38 neuropeptide dnsmasq: using nameserver 126.96.36.199#53
Oct 14 13:38:38 neuropeptide dnsmasq: using nameserver 188.8.131.52#53
Oct 14 13:38:44 neuropeptide dnsmasq: reading
Oct 14 13:38:44 neuropeptide dnsmasq: using nameserver 184.108.40.206#53
Oct 14 13:38:44 neuropeptide dnsmasq: using nameserver 220.127.116.11#53
Should not dnsmasq list all name servers and resolv files when
restarted or started? Touching the resolv files works like a charm
> You need to ensure that the relevant resolv.conf file is updated when a
> network link goes live and all should be well.
dhclient or pppd ip-up or up-down should change these files, so it
should not be a problem ...
More information about the Dnsmasq-discuss