How to make resolv.conf find another DNS server?

Moderator: BarryK

Post Reply
anilraj
Posts: 15
Joined: Mon Dec 27, 2021 6:18 am
Been thanked: 1 time

How to make resolv.conf find another DNS server?

Post 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

williwaw
Posts: 1957
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 172 times
Been thanked: 371 times

Re: Help needed on resolv.conf

Post 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.

anilraj
Posts: 15
Joined: Mon Dec 27, 2021 6:18 am
Been thanked: 1 time

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

Post 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,

Philh
Posts: 30
Joined: Sun Aug 16, 2020 1:50 pm
Been thanked: 7 times

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

Post 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

anilraj
Posts: 15
Joined: Mon Dec 27, 2021 6:18 am
Been thanked: 1 time

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

Post by anilraj »

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

ozsouth
Posts: 1570
Joined: Sun Jul 12, 2020 2:38 am
Location: S.E. Australia
Has thanked: 241 times
Been thanked: 704 times

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

Post by ozsouth »

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

scsijon
Posts: 202
Joined: Fri Jul 24, 2020 10:11 am
Has thanked: 6 times
Been thanked: 18 times

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

Post 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.

Post Reply

Return to “EasyOS”