# [Solved] How to fix the dns server address

## buptwugh

My NIC eth0 and wlan0 both connect to the Internet by DHCP

Recently I want to do some network test and I need to fix my DNS server address.

First 

I change the  /etc/resolv.conf

Delete the nameserver and add the nameserver I want to use.

When I change it, I can use this nameserver, but about after several minutes the resolv.conf is changed by dhcp.

So the nameserver I have added disappeared.

```

# Generated by dhcpcd from wlan0

domain bupt.edu.cn

nameserver 10.3.9.4

nameserver 10.3.9.5

```

How can I solved it?

By google I find that I can change my peerdns , But I can not find the related configure file.

 :Question:   :Question:   :Question:   :Question: Last edited by buptwugh on Tue Feb 28, 2012 1:05 pm; edited 1 time in total

----------

## Yuu

Hi buptwugh,

maybe you should try using net-dns/openresolv, to set static nameservers (link).

Or, just simply by using the option "nodns" to your DHCP configuration (see here) if you don't want DHCP to change your nameservers. And if you want static nameservers, you could also use the "dns_servers" option.

Good luck :]

----------

## buptwugh

Thanks, I will try it.

----------

## Yuu

Hi buptwugh,

don't forget to add "[SOLVED]" to your topic name; if it's solved now  :Wink: 

----------

## buptwugh

Thanks Yuu,

Add the "nodns" option can solved the problem.

These day I am busy doing my homework, So I forget this topic.

Sorry.

----------

