You are not logged in.

#1 2013-07-22 07:03:13

Gradient
Member
Registered: 2013-05-19
Posts: 101

Prevent netctl from modifying resolv.conf

I want to manage my resolv.conf, but when I load a profile and I comment out the 'DNS...' line, resolv.conf becomes blank. How do I tell netctl not to touch to resolv.conf?

My solution so far is to modify this line in the resolvconf.conf file :

resolv_conf=resolv.conf2

This way, when netctl uses resolvconf to modify resolv.conf, it modifies another file.

But there must be a better solution?

Last edited by Gradient (2013-07-22 07:18:11)

Offline

#2 2013-07-22 07:21:03

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,590

Re: Prevent netctl from modifying resolv.conf

Offline

#3 2013-07-22 08:01:27

Gradient
Member
Registered: 2013-05-19
Posts: 101

Re: Prevent netctl from modifying resolv.conf

I forgot to mention that I have a static IP. Your link seems to talk about dhcpcd. I don't think it would apply to my problem. I might be wrong though...

Offline

#4 2013-07-22 08:27:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Prevent netctl from modifying resolv.conf

Did you try commenting the "resolv_conf" line? If commenting the line works, then you can accept the solution as intended behavior. Try and see if the service throws an error (via systemctl status for example).

Offline

#5 2013-07-22 08:41:38

Gradient
Member
Registered: 2013-05-19
Posts: 101

Re: Prevent netctl from modifying resolv.conf

It seems like your solution works. Strangely, the timestamp of resolv.conf is updated, but the content is not modified...

Offline

#6 2013-07-24 16:28:57

gsgleason
Member
Registered: 2012-10-08
Posts: 71

Re: Prevent netctl from modifying resolv.conf

A little late suggestion, but you could make the file immutable with chattr.

Offline

#7 2013-07-24 16:59:25

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Prevent netctl from modifying resolv.conf

That's odd. I thought chattr was already mentioned in this thread, because after reading it, I disappeared in man chattr for a while. Weird.

Offline

#8 2013-07-24 17:16:35

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: Prevent netctl from modifying resolv.conf

In my opinion, it is a good idea to have profile specific nameservers. If you want fallback nameservers, add them using name_servers_append in resolvconf.conf. If you want a nameserver which is always queried first, use name_servers.

Edit: If you really want a static resolv.conf, then uninstall openresolv and replace it with a dummy package which links resolvconf to /bin/true.

Last edited by progandy (2013-07-24 17:18:35)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2013-07-25 10:53:18

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: Prevent netctl from modifying resolv.conf

I'm so glad I've never migrated from netcfg.
Overwriting resolv.conf is the sort of horribleness reserved for the likes of gnomes' networkmanager.
DON'T TOUCH MY CONFIGURATION FILES FFS.
Thank you and good night.


You're just jealous because the voices only talk to me.

Offline

#10 2013-07-25 20:31:55

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Prevent netctl from modifying resolv.conf

Well, moetunes, resolv.conf has always been subject to automated changes on dynamic network configurations.

Offline

Board footer

Powered by FluxBB