You are not logged in.

#1 2014-08-05 06:21:41

rchiang
Member
Registered: 2012-07-05
Posts: 13

How to remove "domain" line in /etc/resolv.conf

I'm using Network Manager and dnsmasq.
My /etc/resolv.conf is like this

# Generated by resolvconf
domain aa.bbb.ccc
nameserver 127.0.0.1

The Ethernet Network configuration in NetworkManager is:

Method: Automatic (DHCP) addresses only
DNS servers: xx.xx.xx.xx

The network worked fine. But I also need to connect VPN, which is configured as

Method: Automatic (DHCP) addresses only
DNS servers: yy.yy.yy.yy
Search Domains: ddddd.eeee

After I connect to VPN, the /etc/resolv.conf becomes:

# Generated by resolvconf
domain aa.bbb.ccc
search aa.bbb.ccc ddddd.eeee
nameserver 127.0.0.1

There are hostname conflict between the 2 domains, such as "svn", "jenkins". I want to access "svn" in ddddd.eeee, but the hostname is interpreted as svn.aa.bbb.ccc

I don't know why there is the line "domain aa.bbb.ccc" in the /etc/resolv.conf.
To reproduce the issue, I installed a virtualbox arch linux guest, and setup network using the same configurations,  but no "domain" line in the /etc/resolv.conf.

Could anyone tell me how to fix this issue? 

Thanks,
Robert

Offline

#2 2014-08-05 07:16:28

lahwaacz
Wiki Admin
From: Czech Republic
Registered: 2012-05-29
Posts: 764

Re: How to remove "domain" line in /etc/resolv.conf

If you connect to a different network, is the domain line still in the resolv.conf file? My guess is that the 'domain aa.bbb.ccc' line is present because NetworkManager obtained such information from the DHCP server.

Offline

#3 2014-08-05 07:50:12

rchiang
Member
Registered: 2012-07-05
Posts: 13

Re: How to remove "domain" line in /etc/resolv.conf

But when testing in virtualbox guest, I connected to the same network with same configurations, there is no "domain" line in /etc/resolv.conf.
I think "Automatic (DHCP) addresses only" of NetworkManager should not insert "domain" to /etc/resolv.conf

lahwaacz wrote:

If you connect to a different network, is the domain line still in the resolv.conf file? My guess is that the 'domain aa.bbb.ccc' line is present because NetworkManager obtained such information from the DHCP server.

Offline

Board footer

Powered by FluxBB