When I modify an ifcfg-....
configuration file for a newtork interface and add DNS1 & DNS2 entries, these DNS values are appended to /etc/resolv.conf
by Network-Manager service when this service starts
And those DNS servers are used for system-wide DNS queries in up-down order.
Then, when I manually delete the entries from resolv.conf and save the file, system can't resolve domain names anymore and this takes effect immediately.
Even if we still have DNS1=...
, DNS2=...
entries in interface configuration files, they don't work.
So, it looks like linux apps take resolv.conf
into considiration. Not anything else.
My question is;
If DNS1
and DNS2
lines in ifcfg-....
configuration files need to be in /etc/resolv.conf
to work, and as we already know resolv.conf
is not bound to a specific network interface, so this is a system-wide setting, why do we define DNS servers in network configuration files, not just in resolv.conf?
Was setting DNS servers in network interface configuration files designed to make DNS queries adapter-specific once but not implemented yet, so these DNS server ip addresses are simply appended to good old /etc/resolv.conf
to do the work?