# Why is my resolv.conf overwritten any now and then?

## muebi

Hi, 

I have the strange problem that my resolv.conf file gets overwritten every couple of hours or so and I have to manually create it then. Otherwise I cannot browse the web anymore e.g. with firefox.

Can anybody help me to fix this problem please?

----------

## ikshaar

resolv.conf is automatically generated. Was changed a while ago. Now top line of resolv.conf mentions

 *Quote:*   

> # Generated by resolvconf

 

your config should now be set in /etc/conf.d/net instead

```
dns_servers_eth0="192.168.0.1"
```

----------

## salmonix

Spposed to be true, but I am having the same problem.

If I have this setting:

 *Quote:*   

>  dns_domain_eth0="salmonix.thruhere.net"
> 
>  mac_eth5="xx:xx:xx:xx:xx"
> 
>  dhcp_eth0=("nodns")
> ...

 

resolv.conf is overwritten.

eth5 is looking out, gets IP from the ISP.

----------

## albright

try adding this to /etc/conf.d/net

dhcp_ethX=( "nodns" )

where X is the proper interface number

(and make sure you have the right servers in resolv.conf  :Smile:   )

----------

## salmonix

I have it in net file, but the problem is the same.

----------

## albright

sorry I didn't pay enough attention; but is it possible

that the eth5 is causing the problem - what if

you set eth5 to nodns?

----------

## salmonix

Thanx. Must be some degenerating effect on my brain capacity.

Age or aliens.

----------

## mwhite

I tried the dhcp_eth0=("nodns") statement in /etc/conf.d/net but resolv.conf still gets written over every time I boot.  BTW, AFAIK, a dhcp client isn't even running on this machine.  there's no DHCP listed when I run rc-update -s and there no /etc/dhcp.conf file.  This is a new server built with r10.  My older gentoo servers don't have this problem at all.   Any ideas?  thanks.

----------

## mwhite

 *ikshaar wrote:*   

> resolv.conf is automatically generated. Was changed a while ago. Now top line of resolv.conf mentions
> 
>  *Quote:*   # Generated by resolvconf 
> 
> your config should now be set in /etc/conf.d/net instead
> ...

 

This is the fix.  Thanks Ikshaar.    Too bad resolv.conf doesn't mention the net files needs to be used instead.

----------

## eugen_mihailescu

 *salmonix wrote:*   

> I have it in net file, but the problem is the same.

 

Is it possible that you have some definition not only in /etc/conf.d/net but also in /etc/conf.d/network and/or /etc/resolv.conf.head ?

----------

## Hu

 *eugen_mihailescu wrote:*   

>  *salmonix wrote:*   I have it in net file, but the problem is the same. 
> 
> Is it possible that you have some definition not only in /etc/conf.d/net but also in /etc/conf.d/network and/or /etc/resolv.conf.head ?

 The poster you quoted already resolved his issue.  Further, prior to your post, the most recent post in this thread was made almost a year before you even joined the Gentoo forums, and more than three years before your post.

----------

