# Resolv.conf being overwritten at boot Seriously Bad Idea

## fogpipe

I discovered that my resolv.conf was being overwritten at every boot. Since im configured for a static ip and my name server is currently sitting about 2 feet away, this wasnt working for me.

A little reading of the openrc docs informed me that if i didnt like this i could install another package, resolv-gentoo or something, i have forgotten the exact name, and the install docs i used made no mention of either the overwriting or of the extra package. I dont beleive i have seen anything like this in any other linux. But my question is this:

How can you justify this? Have hardware and networking become so reliable that machines dont need to be rebooted and dns changes dont need to be made on the fly?

This seems a seriously bad idea.Last edited by fogpipe on Sun May 27, 2012 7:34 pm; edited 1 time in total

----------

## platojones

 *fogpipe wrote:*   

> I discovered that my resolv.conf was being overwritten at every boot. Since im configured for a static ip and my name server is currently sitting about 2 feet away, this wasnt working for me.
> 
> A little reading of the openrc docs informed me that if i didnt like this i could install another package, resolv-gentoo or something, i have forgotten the exact name, and the install docs i used made no mention of either the overwriting or of the extra package. But my question is this:
> 
> How can you justify this? Have hardware and networking become so reliable that machines dont need to be rebooted and dns changes dont need to be made on the fly?
> ...

 

Are you running dhcp by any chance?

----------

## fogpipe

 *platojones wrote:*   

>  *fogpipe wrote:*   I discovered that my resolv.conf was being overwritten at every boot. Since im configured for a static ip and my name server is currently sitting about 2 feet away, this wasnt working for me.
> 
> A little reading of the openrc docs informed me that if i didnt like this i could install another package, resolv-gentoo or something, i have forgotten the exact name, and the install docs i used made no mention of either the overwriting or of the extra package. But my question is this:
> 
> How can you justify this? Have hardware and networking become so reliable that machines dont need to be rebooted and dns changes dont need to be made on the fly?
> ...

 

No. The problem is fixed. I just cant figure out why on earth anyone would build this kind of "feature" into the network config of any linux distro.

Actually, the better way might be to have openrc check resolv.conf for a line containing "nameserver" and digits in the order of "xxx.xxx.xxx.xxx" and to then NOT over write that line.

----------

## Jaglover

That's weird. My resolv.conf is not overwritten at boot. Running up to date ~amd64.

----------

## Hu

fogpipe: could you clarify about what you think should be different?  It is not clear to me whether you object to having OpenRC manage your resolv.conf file at boot or whether you think that this management means you can only change settings at boot?  You can change the settings whenever you want, and they will be respected by any application that reads the file afterward.  You can instruct OpenRC not to manage those settings, or to apply fixed values if you do not use DHCP.

----------

## fogpipe

 *Hu wrote:*   

> fogpipe: could you clarify about what you think should be different?  It is not clear to me whether you object to having OpenRC manage your resolv.conf file at boot or whether you think that this management means you can only change settings at boot?  You can change the settings whenever you want, and they will be respected by any application that reads the file afterward.  You can instruct OpenRC not to manage those settings, or to apply fixed values if you do not use DHCP.

 

I know when i can change those settings and how applications use /etc/resolve.conf and i have solved the problem. What i think should be different is that openrc should not overwrite /etc/resolv.conf at boot. One line in /etc/resolv.conf can make or break network access. If you read the forum, i am not the only one who has had a problem with this default behavior.

----------

## krinn

 *Quote:*   

> 
> 
> and i have solved the problem

 

Could you share how you solve it ? I wish to know how you configure openrc to not overwrite resolv.conf

----------

## Jaglover

 *krinn wrote:*   

>  *Quote:*   
> 
> and i have solved the problem 
> 
> Could you share how you solve it ? I wish to know how you configure openrc to not overwrite resolv.conf

 

I second that. You had a problem, you posted here, you solved it, please share.

----------

## fogpipe

I got it to overwrite resolv.conf with what i wanted it to contain. See the /usr/share/doc/openrc-xxx dir look at the net.example file.

----------

## ulenrich

using dhcpcd daemon, then "resolv.conf" in /etc/dhcpcd.conf:

nohook lookup-hostname , resolv.conf

----------

## albright

maybe I don't understand this problem but why

can't you just add

```
dhcp_wlan0="nodns"
```

(or whatever the interface is called?) to

/etc/conf.d/net?

Wouldn't that be simpler? Or wouldn't that work for some

reason?

----------

