# Setting static nameservers (dns servers)

## BullShark

Hello all, On my new Gentoo system, I am using static ip information. However, each time I reboot, my /etc/resolv.conf gets reset and it's missing the nameserver 192.168.1.1 line I added to it. It looks like this after a reboot.

```
bullshark@beastlinux ~ $ cat /etc/resolv.conf

# Generated by net-scripts for interface eth0

domain 192.168.1.1

bullshark@beastlinux ~ $
```

My /etc/conf.d/net:

```
bullshark@beastlinux ~ $ cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc*/net.example* and save your configuration

# in /etc/conf.d/net (this file :]!).

dns_domain_lo="bhnetwork"

config_eth0="192.168.1.117 netmask 255.255.255.0 brd 192.168.1.0"

routes_eth0="default via 192.168.1.1"

gateways_eth0="192.168.1.1"

dns_domain_eth0="192.168.1.1"

bullshark@beastlinux ~ $
```

I tried adding that last line as an experiment (  dns_domain_eth0="192.168.1.1" ). It didn't work. It seems my /etc/resolv.conf is auto-regenerated each time the network devices are restarted (such as when rebooting), and I'd like to get the nameserver 192.168.1.1 line in there. Help please.

----------

## khayyam

BullShark ...

I think the option you are looking for is dns_servers

```
dns_servers_eth0="192.168.1.1"
```

HTH & best ...

khay

----------

