Page 1 of 1

How to make resolv.conf find another DNS server?

Posted: Wed Jul 31, 2024 7:38 pm
by anilraj

Team, I have a problem and need your help. I am on latest Easyos.

-I use three dns servers (two from google and one provided by isp).
Many a times, isp provided dns server is down and hence I want to tune resolv.conf.
Adding " timeout and attempts options" is not helping to switch to next available one faster

-If I add options "timeout and attempts", it does not help. It still takes same time (seems default time) for lookups.
With or without these options, it still takes same time to resolv. Should it not resolv faster with those optons defined?

1. time command output without "timeout and attempts options defined (time nslookup yahoo.com)
resolv.conf as follows.
nameserver 192.168.1.15
nameserver 8.8.8.8
nameserver 8.8.4.4

# time nslookup yahoo.com
Server: 8.8.8.8
Address: 8.8.8.8:53

Non-authoritative answer:
Name: yahoo.com
Address: 74.6.231.20
Name: yahoo.com
Address: 74.6.231.21
Name: yahoo.com
Address: 98.137.11.164
Name: yahoo.com
Address: 74.6.143.25
Name: yahoo.com
Address: 74.6.143.26
Name: yahoo.com
Address: 98.137.11.163

Non-authoritative answer:
Name: yahoo.com
Address: 2001:4998:44:3507::8001
Name: yahoo.com
Address: 2001:4998:124:1507::f001
Name: yahoo.com
Address: 2001:4998:124:1507::f000
Name: yahoo.com
Address: 2001:4998:44:3507::8000
Name: yahoo.com
Address: 2001:4998:24:120d::1:0
Name: yahoo.com
Address: 2001:4998:24:120d::1:1

real 0m5.018s
user 0m0.000s
sys 0m0.002s

2. time command output with "timeout and attempts options defined (time nslookup yahoo.com)
resolv.conf as follows
options timeout:1 attempts:1
nameserver 192.168.1.15
nameserver 8.8.8.8
nameserver 8.8.4.4

# time nslookup yahoo.com
Server: 8.8.8.8
Address: 8.8.8.8:53

Non-authoritative answer:
Name: yahoo.com
Address: 2001:4998:44:3507::8001
Name: yahoo.com
Address: 2001:4998:44:3507::8000
Name: yahoo.com
Address: 2001:4998:124:1507::f000
Name: yahoo.com
Address: 2001:4998:124:1507::f001
Name: yahoo.com
Address: 2001:4998:24:120d::1:1
Name: yahoo.com
Address: 2001:4998:24:120d::1:0

Non-authoritative answer:
Name: yahoo.com
Address: 74.6.143.25
Name: yahoo.com
Address: 98.137.11.163
Name: yahoo.com
Address: 74.6.143.26
Name: yahoo.com
Address: 74.6.231.20
Name: yahoo.com
Address: 74.6.231.21
Name: yahoo.com
Address: 98.137.11.164

real 0m5.019s
user 0m0.001s
sys 0m0.000s


Re: Help needed on resolv.conf

Posted: Wed Jul 31, 2024 9:17 pm
by williwaw

Hi Anilraj

I have not worked with modifying/etc/resolv.conf lately as I now set DNS in my router. I use a maintained DNS server that also blocks ads Of course if I were to take my laptop somewhere else, whatever ISP is in use wherever would prevail.

I do remember having personalized copy of /etc/resolv.conf and a script in
/root/Startup that would replace one with the other. There were issues and I never persued this solution very far.


Re: How to make resolv.conf find another DNS server?

Posted: Thu Aug 01, 2024 7:55 am
by anilraj

Thank you for the reply. No doubt. need to address problem with isp dns server.
But the major thing I am not able to udnerstand is , why setting those parameters is not helping!! (timeout and attempts)

Regards,


Re: How to make resolv.conf find another DNS server?

Posted: Thu Aug 01, 2024 9:07 am
by Philh

I think you need nameserver first and one option per line

nameserver 192.168.1.15
nameserver 8.8.8.8
nameserver 8.8.4.4
options timeout:1
options attempts:1


Re: How to make resolv.conf find another DNS server?

Posted: Thu Aug 01, 2024 2:48 pm
by anilraj

Hello. That does not work as well. I guess, its something to do with "networkmanager" managing resolv.conf. Exploring that further.


Re: How to make resolv.conf find another DNS server?

Posted: Tue Nov 12, 2024 11:40 am
by ozsouth

I made a script to set google dns as nameservers (fast & apparently secure).
See: viewtopic.php?p=135625#p135625


Re: How to make resolv.conf find another DNS server?

Posted: Tue Nov 19, 2024 5:31 am
by scsijon

Theoretically, all you should need to have is the list of nameserver lines in resolv.conf under each other for it to work and step-on if unavailable within a preset time, however there are quite a few "accidentally" incorrect in the cloud and we don't have the right to fix them, only their webmaster has, so if they don't want to, ....... You could always block them, as my best choice in that case, but that can cause other problems where linkages and multi-paths are concerned so it can be frustrating. At least try to contact the relevant webmaster a couple of times first, asking for an agnolagement reply at least. I did once have to work with one of them where the problem could be only found to fail from a specific group of servers, the end result being a buffer problem (not enough of them), and that still took a few weeks to resolv when it was actually tracked down as some hardware needed replacing.
Alternative you could set it to work round robbin with the rotate command.