I
I
I_AM_SHEF2020-01-10 19:22:40
CentOS
I_AM_SHEF, 2020-01-10 19:22:40

Setting DNS CentOS7?

Good afternoon!
How to speed up switching between the specified DNS in the system?
Those. two DNS servers are registered in /etc/resolv.conf. When DNS1 is disabled, the system sends a query to DNS2 after a long time (5-10 seconds). How to make a request for DNS2 leave, let's say, in 1-2 seconds?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaly Karasik, 2020-01-11
@I_AM_SHEF

timeout:n - see https://www.thegeekdiary.com/how-to-change-time-in...

H
hint000, 2020-01-11
@hint000

Set up a local caching DNS server (there are several options for different tastes), in its settings specify DNS1, DNS2 forwards (and at least a hundred others). In some cases, you can explicitly specify timeouts, you can send requests simultaneously to several servers (i.e. without a pause, just whoever answered first is the one and the slippers), you can override the caching time ...
This event is definitely worth doing for the local network. For one server - well, if not laziness.

A
akelsey, 2020-01-11
@akelsey

No way. How does your computer know that DNS1 is down? He checks the first, does not answer if he goes to the second. In order for the second to become the first, there is an administrator.
To implement auto-switching, you need either a script that will parse responses from dns and change them in the system, or an additional service like a balancer (although this is redundant in your task), which will know that one dns is not available and everyone needs to be driven to second.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question