# [solved] unknown host when I ping

## santiagorf

Hi all,

I finished installing gentoo. Though I can ping to any ip without problems, when I 

```
ping -c 3 www.gentoo.org

```

I get 

```
ping: unknown host
```

Some files are:

```
# /etc/conf.d/hostname

# Set to the hostname of this machine

HOSTNAME="tux"

```

```
/etc/conf.d/net

dns_domain_lo="homenetwork"

config_eth0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" )

routes_eth0=( "default via 192.168.0.1" )
```

```
/etc/hosts

127.0.0.1   tux.homenetwork tux localhost
```

any idea?Last edited by santiagorf on Wed Feb 25, 2009 6:24 pm; edited 1 time in total

----------

## kite14

Hi, please post your /etc/resolv.conf; it's where you should specify the Domain Name Server IP and should look like this:

```
# OpenDNS servers

#

nameserver 208.67.220.220

nameserver 208.67.222.222

#

# host domain 

domain homenetwork
```

You can replace the OpenDNS servers with any others of your choice (usually your ISP provides their own).

----------

## santiagorf

now it works. thank you!!!

----------

## timeBandit

Do not edit /etc/resolv.conf, it is overwritten each time network services are brought up. Define your nameservers with the rest of your network config:

```
# Example: NAT router provides DNS proxy

dns_servers_eth0="192.168.0.1"

# Example: OpenDNS

dns_servers_eth0="208.67.220.220 208.67.222.222"
```

Pick one or roll your own.

----------

## kite14

@ timeBandit:

 *timeBandit wrote:*   

> Do not edit /etc/resolv.conf, it is overwritten each time network services are brought up.

 

I took note of your suggestion, but I've always followed the Installation Handbook which says (in "Manual Network configuration"): *Quote:*   

> Now open /etc/resolv.conf with your favorite editor (in our example, we use nano) [...] Now fill in your nameserver(s) using the following as a template. Make sure you substitute ${NAMESERVER1} and ${NAMESERVER2} with the appropriate nameserver addresses:
> 
> ```
> nameserver ${NAMESERVER1}
> 
> ...

 

without having any issues of this file being overwritten.

Is to be considered a "best practice" to edit only /etc/conf.d/net ?

----------

