# Disabling automatic updating of the /etc/resolv.conf[Solved]

## PM17E5

I'm sorry if this may seem like a stupid question, but does anyone know which line I should modify in the /etc/dhcpcd.conf file in order to prevent it from updating /etc/resolv.conf file each time it gets a new dhcp lease? I'm getting quite annoyed by all these crappy nameservers, when 4.2.2.1 and 4.2.2.2 work so well.Last edited by PM17E5 on Fri Dec 04, 2009 2:54 am; edited 1 time in total

----------

## Ma3oxuct

From dhcpcd.conf:

```
nohook script

             Don't run this hook script.  Matches full name, or prefixed with

             2 numbers optionally ending with .sh.

             So to stop dhcpcd from touching your DNS or MTU settings you

             would do:-

                   nohook resolv.conf, mtu

```

----------

## PM17E5

That's funny, my dhcpcd.conf file never specified anything about that. So to disable it I would just add the line:

```
nohook resolv.conf, mtu
```

Correct? My dhcpcd.conf file looks like the following after that edit:

```
# A sample configuration for dhcpcd.

# See dhcpcd.conf(5) for details.

# Inform the DHCP server of our hostname for DDNS.

hostname

# To share the DHCP lease across OSX and Windows a ClientID is needed.

# Enabling this may get a different lease than the kernel DHCP client.

# Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box.

#clientid

# A list of options to request from the DHCP server.

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

# Most distributions have NTP support.

option ntp_servers

# Respect the network MTU.

option interface_mtu

# A ServerID is required by RFC2131.

require dhcp_server_identifier

# A hook script is provided to lookup the hostname if not set by the DHCP

# server, but it should not be run by default.

nohook lookup-hostname

nohook resolv.conf, mtu
```

I'm really sorry if this whole thread sounds pretty stupid, I haven't played around with dhcpcd settings that much before.

----------

## Ma3oxuct

Remove ", mtu"

So just:

```
nohook resolv.conf
```

----------

## Ma3oxuct

To be on the safe-side do this:

```
nohook lookup-hostname, resolv.conf
```

----------

## PM17E5

Thank you very much, I appreciate it.

----------

