Hello all,
I'm getting frustrated attempting to understand; I googled and asked folks and am unable to get a straight answer.
1. How is the /etc/resolv.conf file maintained ? I do not seem to get a consistent result when I save resolv.conf configuration from GUI or by hand using vim /etc/resolv.conf.
a. Sometimes I the entries toggles between the two entries:
# generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager nameserver 127.0.0.1
b. then when I restart the network services some the /etc/resolv.conf file appears like this: # generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager search lab.mycompany.com nameserver 192.168.17.2
This host is:
- a DNS server that is authoritative for its domain within the 192.168.16/20 network - I believe that even as DNS server, this host should have its resolv.conf file configured to define itself as a DNS server, right?
I apologize for the naive questions, but I am a newbie and am unable to gather a straightforward answer.
thanks in advance.
vincenzo romero wrote:
Hello all,
I'm getting frustrated attempting to understand; I googled and asked folks and am unable to get a straight answer.
- How is the /etc/resolv.conf file maintained ? I do not seem to
get a consistent result when I save resolv.conf configuration from GUI or by hand using vim /etc/resolv.conf.
a. Sometimes I the entries toggles between the two entries:
# generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager nameserver 127.0.0.1
b. then when I restart the network services some the /etc/resolv.conf file appears like this: # generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager search lab.mycompany.com nameserver 192.168.17.2
This host is:
- a DNS server that is authoritative for its domain within the
192.168.16/20 network
- I believe that even as DNS server, this host should have its
resolv.conf file configured to define itself as a DNS server, right?
yes. programs that run on the box do not know if there is a dns server running.
I have always configured resolv.conf manually.
I apologize for the naive questions, but I am a newbie and am unable to gather a straightforward answer.
thanks in advance.
vincenzo romero wrote:
Hello all,
I'm getting frustrated attempting to understand; I googled and asked folks and am unable to get a straight answer.
- How is the /etc/resolv.conf file maintained ?
If you are using DHCP, then the content of resolv.conf SHOULD be at the mercy of your DHCLIENT and the DHCP server.
In your case you are using NetworkManager, and it is getting information from the DHCP server to setup resolv.conf...
I do not seem to get a consistent result when I save resolv.conf configuration from GUI or by hand using vim /etc/resolv.conf.
If you do it by hand, it MAY get overwritten by NetworkManager, or NM may fail to change it (depends on a couple obscure DHCP items), and then nothing works! (been there done that at IEEE meeting last week).
a. Sometimes I the entries toggles between the two entries:
# generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager nameserver 127.0.0.1
This is just bad. Perhaps the DHCP server did not supply DNS resolv information and NM then didi 'its best'.
b. then when I restart the network services some the /etc/resolv.conf file appears like this: # generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager search lab.mycompany.com nameserver 192.168.17.2
This is a more typical result.
This host is:
- a DNS server that is authoritative for its domain within the
192.168.16/20 network
If it is a DNS server, then it SHOULD NOT be using DHCP to set its own address. You should be using static addressing.
- I believe that even as DNS server, this host should have its
resolv.conf file configured to define itself as a DNS server, right?
So your first case is ALMOST right. resolv.conf should not point to the loopback address, but to the static address of the host. But if you have not configured NM for static addressing, well you get what you got.
So your first case is ALMOST right. resolv.conf should not point to the loopback address, but to the static address of the host. But if you have not configured NM for static addressing, well you get what you got.
thanks much for replies ... so to be clear:
qatest1 - 192.168.17.1 (DHCP server) qatest2 - 192.168.17.2 (DNS server)
- both have STATIC-assigned IP address.
1. So I SHOULD leave the DNS entries in /etc/resolv.conf (whether GUI or not) - blank in the DNS server - qatest2? I tried to configure it via the GUI this time with: hostname - qatest2 Primary DNS - 192.168.17.2 # which is its own IP address Search - lab.mycompany.com
After restarting, when I cat /etc/resolv.conf it refers to its loopback address:
# generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager search lab.mycompany.com nameserver 127.0.0.1
2. In the meantime, I configured qatest1 - the DHPC server belonging within qatest2's DNS domain, with the following in Network Manager GUI: hostname - qatest1 Primary DNS - 192.168.17.2 (which is the DNS server's IP) searchpath - lab.mycompany.com
upon restart its /etc/resolv.conf file seems to be correct:
# generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager search lab.mycompany.com nameserver 192.168.17.2
Should I leave my DNS server's /etc/resolv.conf file entries blank?
Thanks in advance,