You are not logged in.

#1 2013-03-18 16:41:42

w201
Member
Registered: 2012-10-04
Posts: 289

[SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

Hey guys,

For some unknown reason /etc/dhcpcd.conf continually overwrites my /etc/resolv.conf file, eventhough I set the "nohook resolv.conf" hook in /etc/dhcpcd.conf.

This is screwing up my DNS and intermittently creating connection problems. Any of you guys know why the hook is not taking effect or how I can stop dhcpcd from overwritting this file?

Thanks

Last edited by w201 (2013-03-18 19:05:15)

Offline

#2 2013-03-18 16:44:32

kaszak696
Member
Registered: 2009-05-26
Posts: 543

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...


'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard

Offline

#3 2013-03-18 16:56:53

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

w201 wrote:

I set the "nohook resolv.conf" hook in /etc/dhcpcd.conf.

kaszak696 wrote:

dhcpcd's configuration file may be edited to prevent the dhcpcd daemon from overwriting /etc/resolv.conf. To do this, add the following to the last section of /etc/dhcpcd.conf:

nohook resolv.conf

I don't think that information will help w201... tongue

I changed my DNS to the Google one (8.8.8.8 or something). That's in "resolv.conf", isn't it? I remember editing some OTHER configuration file, which is then read to create the "resolve.conf" file. There it is, in that link to the wiki, under "Use resolv.conf.head". Does that help you do what you want to do?

Offline

#4 2013-03-18 17:07:02

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

drcouzelis wrote:
w201 wrote:

I set the "nohook resolv.conf" hook in /etc/dhcpcd.conf.

kaszak696 wrote:

dhcpcd's configuration file may be edited to prevent the dhcpcd daemon from overwriting /etc/resolv.conf. To do this, add the following to the last section of /etc/dhcpcd.conf:

nohook resolv.conf

I don't think that information will help w201... tongue

I changed my DNS to the Google one (8.8.8.8 or something). That's in "resolv.conf", isn't it? I remember editing some OTHER configuration file, which is then read to create the "resolve.conf" file. There it is, in that link to the wiki, under "Use resolv.conf.head". Does that help you do what you want to do?

There's three techniques at the wiki link, the nohook one, the resolv.conf.head one and the write-protection attribute.  smile


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2013-03-18 17:08:21

w201
Member
Registered: 2012-10-04
Posts: 289

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

I saw the section in the wiki about using resolv.conf.head. Haven't tried it yet, but what's the difference between that and using the resolv.conf hook in dhcpcd.conf?

I don't know how familiar you are with networking...but perhaps you can answer this... so my resolv.conf file gets overwritten as I stated previously, when I look at the file, the nameservers get overwritten with these long 20 character strings that don't rsemble anything like a URL...noramally it would be 8.8.8.8 or 75.75.75.75. do you have any idea what these numbers mean?

Offline

#6 2013-03-18 17:21:30

kaszak696
Member
Registered: 2009-05-26
Posts: 543

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

drcouzelis wrote:

I don't think that information will help w201... tongue

He edited the post, i'm sure the option he posted initially wasn't 'nohook'.

@w201
Using the resolv.conf.head method does not prevent dhcpcd from editing resolv.conf, it just appends the contents of .head on top of dhcpcd's generated content, hence the .head contents have higher priority. Similarly, entries in resolv.conf.tail are appended after the generated content and have lower priority.
Do these 20-char strings look like IPv6?

Last edited by kaszak696 (2013-03-18 17:29:30)


'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard

Offline

#7 2013-03-18 17:39:04

w201
Member
Registered: 2012-10-04
Posts: 289

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

kaszak696 wrote:
drcouzelis wrote:

I don't think that information will help w201... tongue

He edited the post, i'm sure the option he posted initially wasn't 'nohook'.

@w201
Using the resolv.conf.head method does not prevent dhcpcd from editing resolv.conf, it just appends the contents of .head on top of dhcpcd's generated content, hence the .head contents have higher priority. Similarly, entries in resolv.conf.tail are appended after the generated content and have lower priority.
Do these 20-char strings look like IPv6?


Hey kaszak696, you're right I edited the file I had the wrong info in there. Thank for the info on tail and head, I understand it now.

The 20-char string does look like IPv6. I have a new router and It has IPv6, but I didn't think that was being used yet?

Last edited by w201 (2013-03-18 17:39:24)

Offline

#8 2013-03-18 18:03:34

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

kaszak696 wrote:

He edited the post, i'm sure the option he posted initially wasn't 'nohook'.

That makes sense. I'm sorry. I just thought you were being cheeky. wink

w201 wrote:

I have a new router and It has IPv6, but I didn't think that was being used yet?

It's "in use", but I don't think many people have adopted it yet. Maybe the makers of your new router are PACE SETTERS. big_smile

Offline

#9 2013-03-18 18:56:51

w201
Member
Registered: 2012-10-04
Posts: 289

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

drcouzelis wrote:
kaszak696 wrote:

He edited the post, i'm sure the option he posted initially wasn't 'nohook'.

That makes sense. I'm sorry. I just thought you were being cheeky. wink

w201 wrote:

I have a new router and It has IPv6, but I didn't think that was being used yet?

It's "in use", but I don't think many people have adopted it yet. Maybe the makers of your new router are PACE SETTERS. big_smile

It's a Cisco router I guess you could say they're pace setters. I got a real good deal on an AC 1750.

Thanks for the help!

Offline

#10 2013-03-19 11:30:37

chord
Member
Registered: 2012-11-07
Posts: 121

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

# chattr +i /etc/resolv.conf
is the simplest way to prevent overwriting.

Offline

#11 2013-10-21 17:13:04

WinterIsComing
Member
From: USA
Registered: 2013-09-13
Posts: 8

Re: [SOLVED] How Can I Stop DHCPCD from Overwriting my /etc/resolv.conf...

chord wrote:

# chattr +i /etc/resolv.conf
is the simplest way to prevent overwriting.

Thank you so much! That worked just fine.


▇ ▅ █ ▅ ▇ ▂ ▃ ▁ ▁ ▅ ▃ ▅ ▅ ▄ ▅ ▇
-=] W i n t e r  I s  C o m i n g [=-

Github | deviantART

Offline

Board footer

Powered by FluxBB