# "prepend domain-name-servers" fails



## patpro (Jan 6, 2011)

Hello,

I'm using a FreeBSD 8.1 gateway on my LAN. This gateway connects to the Internet using DHCP. The public interface is defined in my rc.conf as:


```
ifconfig_fxp0="DHCP"
```

and it works. The file resolv.conf is properly updated with my ISP's DNS addresses.
I want to prepend my own local DNS address, but it fails. I've edited /etc/dhclient.conf:


```
interface "fxp0" {
   prepend domain-name-servers 127.0.0.1;
}
```

but when the DHCP bail is renewed, resolv.conf contains only my ISP DNS addresses. Any idea?


----------



## hedgehog (Jan 6, 2011)

try to kill dhclient and restart it manually. if wont work - remove lease file and kill/start it again.


----------



## DutchDaemon (Jan 6, 2011)

Simply use 
	
	



```
prepend domain-name-servers 127.0.0.1;
```
 and nothing else.


----------



## patpro (Jan 11, 2011)

hedgehog: thank you. In fact I rebooted, and it worked well after that.

Before posting here, I've tried [cmd=]/etc/rc.d/dhclient restart[/cmd] in vain  

Now I know dhclient won't restart using its rc script.


----------

