Discussion:
[Dnsmasq-discuss] How to let dnsmasq using multiple upstream dns servers with non-standard ports.
Hongyi Zhao
2015-09-24 01:56:59 UTC
Permalink
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
--
Hongyi Zhao <***@gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493
Simon Kelley
2015-09-26 20:53:19 UTC
Permalink
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



That should do the trick.


Cheers,

Simon.
Post by Hongyi Zhao
Hi Simon,
I have server upstream dns servers with non-standard ports opening for
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
server server1#port1
server server2#port2
server server3#port3
server server4#port4
sudo dnsmasq -d -p 5353 -r /path/to/resolv-file.dnsmasq --all-servers
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
Hongyi Zhao
2015-09-27 03:44:44 UTC
Permalink
This post might be inappropriate. Click to display it.
Simon Kelley
2015-09-29 21:04:20 UTC
Permalink
Post by Hongyi Zhao
Post by Simon Kelley
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
--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.
Post by Hongyi Zhao
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.
Post by Hongyi Zhao
Post by Simon Kelley
That should do the trick.
Cheers,
Simon.
Post by Hongyi Zhao
Hi Simon,
I have server upstream dns servers with non-standard ports opening for
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
server server1#port1
server server2#port2
server server3#port3
server server4#port4
sudo dnsmasq -d -p 5353 -r /path/to/resolv-file.dnsmasq --all-servers
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
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Hongyi Zhao
2015-09-30 01:02:52 UTC
Permalink
Post by Simon Kelley
Post by Hongyi Zhao
Post by Simon Kelley
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
--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.
Post by Hongyi Zhao
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?
Sorry for my poor english.

Let me describe it as follows:

Just as you have told me: the first answer returned will be the one used.

But, after the the first answer returned, there still will be other
query restults returned subsequently due to the parallelly query done
by `all-servers' option. So, how the dnsmasq deal with the remain
ones? Does it simply discard the remainly returned results?

Regards
Post by Simon Kelley
Cheers,
Simon.
Post by Hongyi Zhao
Post by Simon Kelley
That should do the trick.
Cheers,
Simon.
Post by Hongyi Zhao
Hi Simon,
I have server upstream dns servers with non-standard ports opening for
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
server server1#port1
server server2#port2
server server3#port3
server server4#port4
sudo dnsmasq -d -p 5353 -r /path/to/resolv-file.dnsmasq --all-servers
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
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
--
Hongyi Zhao <***@gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493
Simon Kelley
2015-09-30 21:14:08 UTC
Permalink
Post by Hongyi Zhao
Post by Simon Kelley
2015-09-27 4:53 GMT+08:00 Simon Kelley
Post by Simon Kelley
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
--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?
Sorry for my poor english.
Just as you have told me: the first answer returned will be the one used.
But, after the the first answer returned, there still will be
other query restults returned subsequently due to the parallelly
query done by `all-servers' option. So, how the dnsmasq deal with
the remain ones? Does it simply discard the remainly returned
results?
Yes. That's exactly what it does.


Cheers,

Simon.
Post by Hongyi Zhao
Regards
Post by Simon Kelley
Cheers,
Simon.
Post by Simon Kelley
That should do the trick.
Cheers,
Simon.
Post by Hongyi Zhao
Hi Simon,
I have server upstream dns servers with non-standard ports
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
server server1#port1 server server2#port2 server
server3#port3 server server4#port4
sudo dnsmasq -d -p 5353 -r /path/to/resolv-file.dnsmasq
--all-servers
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
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Loading...