[Dnsmasq-discuss] How to let dnsmasq using multiple upstream dns servers with non-standard ports.

Simon Kelley simon at thekelleys.org.uk
Tue Sep 29 22:04:20 BST 2015


On 27/09/15 04:44, Hongyi Zhao wrote:
> 2015-09-27 4:53 GMT+08:00 Simon Kelley <simon at thekelleys.org.uk>:
>> You can't put non-standard ports in a resolv-file, the format of those
>> files does not include ports.
>>
>> It is possible to put a non-standard port in dnsmasq configuration files
>> using
>>
>> server=server1#port1
>>
>> So simply make your file look like
>>
>> server=server1#port1
>> server=server2#port2
>> server=server3#port3
>> server=server4#port4
>>
>> call it /path/to/servers.dnsmasq
>>
>> and tell dnsmasq to read it as a dnsmasq configuration file.
>>
>>
>> sudo dnsmasq -d -p 5353 -C /path/to/servers.dnsmasq  --all-servers
> 
> According to the help of dnsmasq, it seems that the more appriate
> method should be using the following option to invoke the above
> configuration file:
> 
>     --servers-file=<path>               Specify path to file with
> server= options
> 
> sudo dnsmasq -d -p 5353 --servers-file=/path/to/servers.dnsmasq  --all-servers

Yes, that's a good way to do it.

> 
> In addition, I want to know another thing: how to control the shortest
> time with which I wait for the responding from these upstream dns
> servers.  I mean: when using `--all-servers' option, the dnsmasq will
> query all of these dns servers parallely and I want to use the most
> firstly query returned to me and then throttle the remail query for
> the spefific domain name.  Is this possiable?

The first answer returned will be the one used. I don't understand the
second part of your question, sorry. Could you explain another way what
you want to do?



Cheers,

Simon.

> 
>>
>>
>>
>> That should do the trick.
>>
>>
>> Cheers,
>>
>> Simon.
>>
>>>
>>
>> On 24/09/15 02:56, Hongyi Zhao wrote:
>>> Hi Simon,
>>>
>>> I have server upstream dns servers with non-standard ports opening for
>>> querying, i.e., as follows:
>>>
>>> server1:port1
>>> server2:port2
>>> server3:port3
>>> server4:port4
>>>
>>> I want to use the `--resolv-file=<path>' option to invoking the file
>>> which stored the infomation for these servers.
>>>
>>> Say, I named this file as resolv-file.dnsmasq, and its content has the
>>> following forms:
>>>
>>> server server1#port1
>>> server server2#port2
>>> server server3#port3
>>> server server4#port4
>>>
>>> Then I use the following command to run the dnsmasq:
>>>
>>> sudo dnsmasq -d -p 5353 -r /path/to/resolv-file.dnsmasq  --all-servers
>>>
>>> But, at this step, I get the following errors:
>>>
>>> dnsmasq: no servers found in /path/to/resolv-file.dnsmasq, will retry
>>>
>>> So, how to let dnsmasq using multiple upstream dns servers with
>>> non-standard ports?
>>>
>>> Regards
>>>
>>
>>
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 
> 
> 




More information about the Dnsmasq-discuss mailing list