LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Centos 6.5: search domain not added to /etc/resolv.conf (IPv6 DNS server) (https://www.linuxquestions.org/questions/linux-newbie-8/centos-6-5-search-domain-not-added-to-etc-resolv-conf-ipv6-dns-server-4175516419/)

JohanHarmsen 08-26-2014 08:19 AM

Centos 6.5: search domain not added to /etc/resolv.conf (IPv6 DNS server)
 
hello

If I configure a search domain in the IPv6 Settings tab of the Network configuration for the eth0 device, the domain name is added to the DOMAIN variable in the /etc/sysconfig/network-scripts/ifcfg-eth0 file. If I then restart my network (service network restart) the search domain is not added to /etc/resolv.conf.
This causes that I can only lookup DNS names using the FQDN, and not using the hostname only.
dig myhost : does not work
dig myhost.mydomain: works
It works correctly if I manually add the search domain to /etc/resolv.conf, but if the network is restarted this file is overwritten.
Does anyone know know how to prevent overwriting /etc/resolv.conf

Thanks in advance

Johan

netnix99 08-26-2014 12:25 PM

Johan,

I will make an assumption that you are using DHCP to obtain your address since it appears that NetworkManager is generating your new /etc/resolve.conf file each time you restart the network services.

If you will open up the Network Connections, and select the Ethernet card you are using, and select edit, then IPv4 Settings, you can manually fill in the search domains. You can also add this option into your DHCP server configuration, as well. Editing the Seach Domains on the local NIC is the easiest fix if you are using a home network. If this is a production environment, I would suggest modifying the DHCP configuration, which will differ based on "what" (Linux Box, Windows Server, Network device, etc) is serving DHCP addresses.

JohanHarmsen 08-27-2014 01:54 AM

Hello

I'm not using DHCP, in the network connections I disabled IPv4 and manually configured an IPv6 address. If I enable IPv4 the domain setting is correctly copied to /etc/resolv.conf regardless of the way the IP address is supplied (manual or via DHCP).
This server (vm) was especially setup to experiment with IPv6. The problem exhibited itself when attempting to resolve the name, and I noticed that it only worked with the FQDN and not with just the name. As far as I know the domains specified in /etc/resolv.conf are appended to the name when resolving through DNS.
Maybe this is more a question for Linux-Network forum ?

Thanks for your help anyway !

Johan

netnix99 08-27-2014 07:45 AM

Johan,

Have you given any thought to not running NetworkManager and just manually configuring the IPv6 interfaces? This should allow you to set the DNS servers and search domains, and since NetworkManager isn't running, it won't overwrite your work.

thoughts??

I'm really glad you brought this up, as I hope to start doing some IPv6 testing myself, soon!!

JohanHarmsen 08-27-2014 09:20 AM

Hello

I must admit that I didn't know what the Network Manager is exactly doing. After some reading it appears that I can just as easily do without it. So I stopped and disabled the service, and now my /etc/resolv.conf is no longer overwritten

Thanks for the hint !

Johan


All times are GMT -5. The time now is 02:39 PM.