# name resolution in home network [SOLVED]

## baf

hi,

i have the following situation in my home network (nmap -sP 192.168.0.*):

```
Starting nmap 3.55 ( http://www.insecure.org/nmap/ ) at 2005-12-17 13:03 CET

Host router.homenet (192.168.0.1) appears to be up.

Host 192.168.0.110 appears to be up.

Host 192.168.0.130 appears to be up.

Host win1.homenet (192.168.0.120) appears to be up.

Nmap run completed -- 256 IP addresses (4 hosts up) scanned in 6.974 seconds
```

The dhcp leases log of the router looks like this:

```
84077 00:0b:6d:5c:22:a8 192.168.0.110 * *

83791 00:7c:ac:25:6b:80 192.168.0.120 win1 00:7c:ac:25:6b:80

85543 00:9b:55:45:22:d9 192.168.0.130 * *
```

As you see, there is a router and three computers, two running gentoo (110 and 130) and one running windows xp (120). All of them use the router's dhcp-service. The winXP computer has its workgroup configured to "homenet", which is also the domain set up on the router. So from any machine I can ping the router and the windows machine just by using their names. However the names of the gentoo machines are not being resolved. I can only ping them via their IP addresses.

Why are the names of the gentoo machines not being resolved?

Here the configuration of the 110 machine:

/etc/hostname:

```
gentoo1
```

/etc/hosts:

```
127.0.0.1       gentoo1.homenet gentoo1 localhost
```

/etc/domainname:

```
homenet
```

/etc/dnsdomainname:

```
homenet
```

Anybody an idea what's wrong/missing??

Thanks a lot!

bafLast edited by baf on Sat Dec 17, 2005 3:26 pm; edited 1 time in total

----------

## morodoch

Have you set up /etc/resolv.conf on your gentoo machines? It needs to point at your DNS server (your router?)

It should look something like this, I guess:

```
domain homenet

nameserver your.router.ip.address
```

----------

## baf

I tried this, however /etc/resolv.conf always gets reset to

```
nameserver 192.168.0.1

search homenet
```

----------

## morodoch

That's weird. I've no idea what's touching that file.

Can you ping hostname.homenet?

----------

## baf

Seems like the reset of resolv.conf happens, when "dhcpcd eth1" is executed.

I can ping using (hostname/domainname):

windows --> router

router --> windows

gentoo --> windows

gentoo --> router

I cannot ping:

windows --> gentoo

router --> gentoo

gentoo --> gentoo

----------

## baf

I solved it!   :Very Happy: 

The problem was that in my /etc/conf.d/net I just enabled dhcp for eth1, but did not pass any parameters.

On the command line, a dhcpcd -h gentoo1 eth1 publishes the hostname to the router!

thanks for your help in solving this!

baf

----------

