Where does NetworkManager store the domain name for generating resolv.conf

centos6networkmanager

I am having problems getting my domain name set correctly on CentOS 6. My resolv.conf looks like this:

nameserver 198.6.100.25
nameserver 198.6.100.53
nameserver 198.6.100.38
# Generated by NetworkManager
domain andyshinn.as
search vcolo.andyshinn.as

I have a single eth0 interface with the following configuration:

DEVICE=eth0
BOOTPROTO=none
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
HWADDR=00:0c:29:3b:2a:70
IPADDR=192.168.50.6
NETMASK=255.255.255.0
DNS2=198.6.100.53
GATEWAY=192.168.50.1
DNS1=198.6.100.25
IPV6INIT=no
USERCTL=no

Hosts file for reference also:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.50.6    myvm myvm.vcolo.andyshinn.as

I am trying to change the domain to vcolo.andyshinn.as. But after reboot, it reverts to andyshinn.as. By the inline comment, I can see it is generated by NetworkManager. However, system-config-network-tui doesn't have anything about the domain name (only the search path).

A fgrep -r 'andyshinn.as' /etc/* only brings up /etc/sysconfig/networking/profiles/default/resolv.conf as another choice to edit. But I have tried editing this file also with the same results. This is a virtual machine running in VMware Workstation. But I have the DHCP server disabled for the VMnet interface that the VM is using.

Rather than just blindly disable NetworkManager (which seems to be the answer for most NetworkManager related issues), I would like to understand more about how it works and saves configuration. So how is my system ending up with andyshinn.as as the domain name and what needs to be updated to set it to vcolo.andyshinn.as?

Best Answer

You need to edit the following files: /etc/sysconfig/network. Set the following:

HOSTNAME=vcolo.andyshinn.as
DOMAIN=andyshinn.as
Related Topic