# dns (nameserver) resetting after network restart [solved]

## Majed17

Hello, i have dhcpd installed although i'm not using it.

everytime i change /etc/resolv.conf from:

```
nameserver 172.16.1.1
```

to

```

nameserver 172.16.1.1

nameserver 172.16.1.2
```

and then restart the network by /etc/init.d/net.eth1 restart

the result in resolv.conf is back to

```
nameserver 172.16.1.1
```

any idea what would be causing this? thanks for any help.Last edited by Majed17 on Thu Oct 27, 2011 6:42 am; edited 1 time in total

----------

## solamour

Have you tried the following?

```
   ...

   dhcpcd_eth1="nodns"

```

__

sol

----------

## Majed17

now i tried it and the result it the same..

name server returned to :

```
nameserver 172.16.1.1
```

the net config looks like this now:

```

config_eth1="172.16.1.40/16"

routes_eth1="default via 172.16.1.254" 

dns_servers_eth1="172.16.1.1"

dhcpcd_eth1="nodns"

config_eth2="10.10.10.10/24"

```

/etc/dgcpcd.conf looks like this:

```

# 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
```

should i comment out domain name servers? or is something else causing the issue?

----------

## solamour

Try and let us know the result.

```
config_eth1="172.16.1.40/16"

routes_eth1="default via 172.16.1.254"

dns_servers_eth1="172.16.1.1 172.16.1.2"

#dhcpcd_eth1="nodns"

config_eth2="10.10.10.10/24" 

```

__

sol

----------

## Majed17

ah thanks for the reply, this suggestion really worked  :Smile: 

it now adds 172.16.1.2 automatically to resolv.conf without me adding it manually.

i guess the resolv.conf takes its entries from the dns configuration.

thanks for clearing this issue  :Smile: 

----------

## solamour

Glad to hear it worked out OK. If eth1 happens to be configured as dhcp (config_eth1="dhcp"), then dhcpcd_eth1="nodns" would have made sense, because you don't want to overwrite "/etc/resolv.conf". But if eth1 is static as in your case, either specify dns_servers like you did or just leave it out altogether. 

__

sol

----------

## Majed17

thanks for the tip  :Smile: 

----------

