# resolv.conf not created by dhcp

## blowfish

hi,

i've been using static ip for a while, but wanted to switch to dhcp. it works so far, there is just a problem with the resolv.conf. the old resolv.conf, which i wrote manually, is renamed as it should be. but the new resolv.conf is not created. so dns does not work. when i rename the old resolv.conf to the original name, dns works fine. but i don't want to rename it every time i use dhcp. why doesn' my dhcp create a proper resolv.conf? it should, because the dns-info is given by the server and dhcpcd receives it (looked it up in /var/lib/dhcpc/dhcpcd-eth0.info).

----------

## wynn

What arguments to dhcp are you giving in your /etc/conf.d/net?

----------

## blowfish

i cleared my /etc/conf.d/net, because in the top it says a blank configuration automatically uses dhcp.

----------

## wynn

Would you like to run

```
ifconfig eth0 down

dhcpcd -d eth0
```

and see if this gives any clues?

It can hardly be a permissions problem as the old resolv.conf is renamed which requires the same permissions as creating a new file.

It might be worth looking at /etc/dhcpcd.sh (if it exists) which dhcpcd calls and checking to see if resolvconf (net-dns/resolvconf-gentoo) is installed as, if it is, dhcpcd will pass the DNS information to it rather than dealing with it itself.

----------

## blowfish

```
dhcpcd -d eth0
```

gives:

```

Info, MAC address = 00:15:60:ca:3d:89

Debug, broadcasting DHCP_REQUEST for 192.168.0.18

Debug, dhcpIPaddrLeaseTime=1123200 in DHCP server response.

Debug, DHCP_ACK received from  (192.168.0.200)

Debug, broadcasting ARPOP_REQUEST for 192.168.0.18

Info, verified 192.168.0.18 address is not in use

Info, your IP address = 192.168.0.18

Debug, orig hostname = mobile-machine

```

net-dns/resolfconf-gentoo is installed, but /etc/dhcpcd.sh does not exist.

does this information give you any clues? i'm really getting sick of renaming the resolv.conf after every reboot.

----------

## UberLord

You've got resolvconf installed? Cool.

First off, check that it's configured correctly 

```
cd /etc/

roy@uberpc /etc $ ls -l resolv.conf

lrwxrwxrwx 1 root root 26 2006-07-31 20:11 resolv.conf -> resolvconf/run/resolv.conf
```

That is how it should look.

Then ensure that resolvconf has received the address

```
resolvconf -l
```

If it's not there then restart the interface

```
/etc/init.d/net.eth0 restart
```

Then ensure that resolvconf has received the address

```
resolvconf -l
```

If it has, then cat /etc/resolv.conf and that is how resolvconf thinks your resolv.conf file should look.

----------

## blowfish

```

me@here etc # ls -l resolv.conf 

-rw-r--r-- 1 root root 175 Mar 27 19:49 resolv.conf 

```

is that ok? 

```

root@here etc # resolvconf -l

# resolv.conf for interface eth0

# Generated by dhcpcd for interface eth0

nameserver 192.168.0.200

```

--> seems to work!

```

root@here etc # cat /etc/resolv.conf     

cat: /etc/resolv.conf: No such file or directory

```

there is a file /etc/resolvconf/run/interfaces/eth0, which contains the correct dns-data. so dhcpcd should create a symlink to it, right?

----------

## UberLord

 *blowfish wrote:*   

> 
> 
> ```
> 
> me@here etc # ls -l resolv.conf 
> ...

 

No.

Did you configure resolvconf-gentoo? Do it like so

```
emerge --config resolvconf-gentoo
```

 *Quote:*   

> 
> 
> there is a file /etc/resolvconf/run/interfaces/eth0, which contains the correct dns-data. so dhcpcd should create a symlink to it, right?

 

No, the libc part of resolvconf creates a new resolv.conf based on ALL the dns data for the interfaces.

----------

## blowfish

 *Quote:*   

> emerge --config resolvconf-gentoo

 

that was it! thanks to all. now it works great!

----------

