TipOfTheDay

From TheBestLinux.com
Revision as of 17:40, 28 May 2021 by Jamie (talk | contribs) (Created page with "= '''Tip of the Day''' = <br /> * May 28, 2021 '''The Issue:''' <pre style="color:blue"> /etc/resolv.conf - Why do my DNS lookups not work, or sometimes seem to work, and othe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Tip of the Day


  • May 28, 2021

The Issue:

/etc/resolv.conf - Why do my DNS lookups not work, or sometimes seem to work, and other times don't.


Today's tip of the day is something I just figured out, after having it bug me for many years, and only just now confirming the resolution!

Unfortunately, Network Manager often creates a new /etc/resolv.conf file with the "search" statement preceding the "nameserver" statement(s)! This causes intermittent DNS lookup failures, especially on the local network! This has caused me years of frustration, so my hopes are this will help others avoid my past frustration! :-)

Here is an example of what Network Manager can create, causing my local DNS queries on my own internal BIND9 DNS VM servers to fail:

# Generated by NetworkManager
search dawgland.com
nameserver 192.168.200.103
nameserver 192.168.200.104
nameserver 4.2.2.4


Through trial and error using multiple machines(VM's actually) with multiple distros of Linux, both Red Hat and Debian based, I discovered that the order of the statements within the /etc/resolv.conf file make a HUGE differnce!

The Solution: The nameserver statements MUST come before the "search" statement!!! Such as this example:

# /etc/resolv.conf - Created manually on 05-28-2021
nameserver 192.168.200.103
nameserver 192.168.200.104
nameserver 4.2.2.4
search dawgland.com



The changes take effect immediatelly, without the need to reboot or restart any services. I hope you found this tip of the day useful!