# DNS lookup isnt working properly [SOLVED]

## thecooptoo

DNS is mis-behaving  and i dont know why 

server=grenada, client Im trying to connect to =data

```
grenada ~ # cat /var/lib/misc/dnsmasq.leases

1129611982 00:02:44:07:89:a0 192.168.0.7 nervada 01:00:02:44:07:89:a0

1129618541 00:40:95:44:40:6a 192.168.0.2 Ruths 01:00:40:95:44:40:6a

1129605123 00:12:17:70:a3:d5 192.168.0.14 * 01:00:12:17:70:a3:d5

1129625726 00:0b:ac:e6:63:04 192.168.0.9 DadsLapTop 01:00:0b:ac:e6:63:04

1129615001 00:40:95:44:40:69 192.168.0.8 data 01:00:40:95:44:40:69

1129609352 00:40:95:44:49:b9 192.168.0.12 dads 01:00:40:95:44:49:b9

grenada ~ #    
```

dns lookup is OK

```
grenada ~ # nslookup data

Server:         192.168.0.1

Address:        192.168.0.1#53

Name:   data.home.network

Address: 192.168.0.8

```

and ping 

g

```
renada ~ # ping 192.168.0.8

PING 192.168.0.8 (192.168.0.8) 56(84) bytes of data.

64 bytes from 192.168.0.8: icmp_seq=1 ttl=128 time=0.871 ms

64 bytes from 192.168.0.8: icmp_seq=2 ttl=128 time=0.405 ms

64 bytes from 192.168.0.8: icmp_seq=3 ttl=128 time=0.393 ms

64 bytes from 192.168.0.8: icmp_seq=4 ttl=128 time=0.424 ms
```

but this goes to the wrong place 

```
grenada ~ # ping data

PING data.home.network (192.168.0.9) 56(84) bytes of data.

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=1 ttl=128 time=1.6                       8 ms

64 bytes from DadsLapTop.home.network(192.168.0.9): icmp_seq=2 ttl=128 time=1.5                       7 ms

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=3 ttl=128 time=1.5                       6 ms
```

```
renada ~ # cat /etc/hosts |grep -v '#'

127.0.0.1       localhost

192.168.0.1     grenada.home.network grenada

grenada ~ #                               
```

and Ive no idea why

----------

## jmbsvicetto

Hi.

What do you get when you do the following?

```
ping data.home.network
```

----------

## thecooptoo

```
ada ~ # ping data.home.network 

PING data.home.network (192.168.0.8) 56(84) bytes of data.

64 bytes from dads.home.network (192.168.0.8): icmp_seq=1 ttl=128 time=1.22 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=2 ttl=128 time=0.402 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=3 ttl=128 time=0.407 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=4 ttl=128 time=0.394 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=5 ttl=128 time=0.388 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=6 ttl=128 time=0.414 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=7 ttl=128 time=0.393 ms

--- data.home.network ping statistics ---

7 packets transmitted, 7 received, 0% packet loss, time 6000ms

rtt min/avg/max/mdev = 0.388/0.517/1.227/0.291 ms

```

```

grenada ~ # ping data

PING data.home.network (192.168.0.9) 56(84) bytes of data.

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=1 ttl=128 time=1.94 ms

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=2 ttl=128 time=1.54 ms

```

????

so the FQDN and the name go to different places ????

where does the server  look after /etc/hosts ?

----------

## UberLord

Do you have this in /etc/resolv.conf

```
domain home.network
```

----------

## thecooptoo

```
grenada ~ # cat /etc/resolv.conf

nameserver 192.168.0.1

search home.network

domain home.network

grenada ~ #                  
```

IIRC a default setup for dnsmasq.et

```
grenada ~ # grep ^[A-Za-z0-9] /etc/dnsmasq.conf

bogus-priv

resolv-file=/etc/resolv.conf.inet

interface=eth0

bind-interfaces

expand-hosts

domain=home.network

dhcp-range=192.168.0.2,192.168.0.20,12h

dhcp-option=19,0           # option ip-forwarding off

dhcp-option=44,0.0.0.0     # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)

dhcp-option=45,0.0.0.0     # netbios datagram distribution server

dhcp-option=46,8           # netbios node type

dhcp-option=47             # empty netbios scope.

dhcp-authoritative

grenada ~ #                                        
```

----------

## UberLord

Whats in /etc/resolv.conf.inet ?

----------

## thecooptoo

Ive tried it amalgamating resolv.conf and resolv.conf.inet ( and restarting dnsmasq)

any value in removing the leases file ?

```
grenada ~ # cat /etc/resolv.conf.inet

#nameserver 192.168.0.1

#search home.network

#domain home.network 

nameserver 62.31.144.39

nameserver 195.188.53.175

nameserver 62.31.112.39

grenada ~ #                           
```

----------

## jmbsvicetto

 *thecooptoo wrote:*   

> 
> 
> ```
> ada ~ # ping data.home.network 
> 
> ...

 

Are you using SAMBA? What do you have in the hosts definition of /etc/nsswitch.conf?

----------

## thecooptoo

yes im using SAMBA

```
grenada old-data # cat /etc/nsswitch.conf

# /etc/nsswitch.conf:

# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/nsswitch.conf,v 1.1 2005/05/17 00:52:41 vapier Exp $

passwd:      compat

shadow:      compat

group:       compat

# passwd:    db files nis

# shadow:    db files nis

# group:     db files nis

hosts:       files dns

networks:    files dns

services:    db files

protocols:   db files

rpc:         db files

ethers:      db files

netmasks:    files

netgroup:    files

bootparams:  files

automount:   files

aliases:     files

```

----------

## jmbsvicetto

thecooptoo,

I don't see anything wrong with your nsswitch.conf file. Are you using an WINS server with SAMBA? That shouldn't make any difference. as from your nsswitch.conf file your system should resolve names by first checking /etc/hosts and then using DNS. If you can stop SAMBA on your system, please do it and then try to ping the host by name. Does it work?

----------

## thecooptoo

```
grenada htdocs # ping -c2 data

PING data.home.network (192.168.0.9) 56(84) bytes of data.

64 bytes from DadsLapTop.home.network  (192.168.0.9): icmp_seq=1 ttl=128 time=14.6 ms

64 bytes from DadsLapTop.home.network  (192.168.0.9): icmp_seq=2 ttl=128 time=1.51 ms

--- data.home.network  ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 1.514/8.095/14.676/6.581 ms

grenada htdocs # ping -c2 data.home.network 

PING data.home.network  (192.168.0.8) 56(84) bytes of data.

64 bytes from dads.home.network  (192.168.0.8): icmp_seq=1 ttl=128 time=0.515 ms

64 bytes from dads.home.network  (192.168.0.8): icmp_seq=2 ttl=128 time=0.397 ms

--- data.home.network  ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 0.397/0.456/0.515/0.059 ms

grenada htdocs # /etc/init.d/samba stop

 * samba -> stop: smbd ...                                                                                                                       [ ok ]

 * samba -> stop: nmbd ...                                                                                                                       [ ok ]

grenada htdocs # ping -c2 data.home.network 

PING data.home.network  (192.168.0.8) 56(84) bytes of data.

64 bytes from dads.home.network  (192.168.0.8): icmp_seq=1 ttl=128 time=0.477 ms

64 bytes from dads.home.network  (192.168.0.8): icmp_seq=2 ttl=128 time=0.487 ms

--- data.home.network  ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1001ms

rtt min/avg/max/mdev = 0.477/0.482/0.487/0.005 ms

grenada htdocs # ping -c2 data

PING data.home.network  (192.168.0.9) 56(84) bytes of data.

64 bytes from DadsLapTop.home.network  (192.168.0.9): icmp_seq=1 ttl=128 time=2.10 ms

64 bytes from DadsLapTop.home.network  (192.168.0.9): icmp_seq=2 ttl=128 time=1.54 ms

--- data.home.network  ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 1.549/1.827/2.105/0.278 ms

grenada htdocs #                                                                          
```

----------

## jmbsvicetto

thecooptoo,

can you just add a step after stoping SAMBA and before trying to ping the host?

```
# ping -c2 data.home.network

# ping -c2 data

# /etc/init.d/samba stop

# arp -d data

# ping -c2 data.home.network

# ping -c2 data
```

----------

## thecooptoo

```
grenada / # ping -c2 data.home.network

PING data.home.network (192.168.0.8) 56(84) bytes of data.

64 bytes from dads.home.network (192.168.0.8): icmp_seq=1 ttl=128 time=0.459 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=2 ttl=128 time=0.473 ms

--- data.home.network ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 0.459/0.466/0.473/0.007 ms

grenada / # ping -c2 data

PING data.home.network (192.168.0.9) 56(84) bytes of data.

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=1 ttl=128 time=1.55 ms

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=2 ttl=128 time=1.60 ms

--- data.home.network ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 1.553/1.578/1.604/0.047 ms

grenada / # /etc/init.d/samba stop

 * samba -> stop: smbd ...                                                                                                                       [ ok ]

 * samba -> stop: nmbd ...                                                                                                                       [ ok ]

grenada / # arp -d data

grenada / # ping -c2 data.home.network

PING data.home.network (192.168.0.8) 56(84) bytes of data.

64 bytes from dads.home.network (192.168.0.8): icmp_seq=1 ttl=128 time=0.472 ms

64 bytes from dads.home.network (192.168.0.8): icmp_seq=2 ttl=128 time=0.391 ms

--- data.home.network ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 0.391/0.431/0.472/0.045 ms

grenada / # ping -c2 data

PING data.home.network (192.168.0.9) 56(84) bytes of data.

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=1 ttl=128 time=1.82 ms

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=2 ttl=128 time=1.94 ms

--- data.home.network ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1000ms

rtt min/avg/max/mdev = 1.825/1.883/1.941/0.058 ms

grenada / #                                                                       
```

----------

## jmbsvicetto

thecooptoo,

and data is not defined in /etc/hosts? That's starting to be a mistery to me.

What do you get when you do

```
# grep -R data /etc
```

----------

## thecooptoo

ive removed all the stuff it fond in 

/etc/exim/*

etc/env.d/gcc/i686-pc-linux-gnu-3.3.6

/etc/env.d/05gcc

/etc/init.d/mysql

/etc/runlevels/default

/etc/php/*

/etc/ssl

/etc/lynx/*

/etc/snort/

/etc/apache2

/etc/webmin

theres an awful lot - i can post it back if you think its necessary 

```
grenada / # grep -R data /etc

/etc/rpc:database_svc   100016

/etc/make.conf:#     temporary storage of data. This can get VERY large depending upon

/etc/make.conf:# or '--getbinpkgonly' will cause portage to retrieve the metadata from all

/etc/make.conf:# packages in the directory specified, and use that data to determine what will

/etc/make.conf:#     for all rapid operations such as lockfiles and transient data.

/etc/csh.env:setenv INFOPATH '/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info'

/etc/csh.env:setenv MANPATH '/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man::/opt/blackdown-jre-1.4.2.02/man'

/etc/profile.env:export INFOPATH='/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info'

/etc/profile.env:export MANPATH='/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man::/opt/blackdown-jre-1.4.2.02/man'

/etc/bash/bashrc:# dircolors --print-database uses its own built-in database

/etc/bash/bashrc:       if dircolors --print-database | grep -q "^TERM ${safe_term}" ; then

/etc/services:ftp-data  20/tcp                          # File Transfer [Default Data]

/etc/services:ftp-data  20/udp

/etc/services:emfis-data        140/tcp                         # EMFIS Data Service

/etc/services:emfis-data        140/udp

/etc/services:ftps-data 989/tcp                         # ftp protocol, data, over TLS/SSL

/etc/services:ftps-data 989/udp

/etc/services:datametrics       1645/tcp        old-radius      # datametrics / old radius entry

/etc/services:datametrics       1645/udp        old-radius

/etc/services:afs3-prserver   7002/tcp                  # users & groups database

/etc/services:afs3-vlserver   7003/tcp                  # volume location database

/etc/make.conf.example:#     temporary storage of data. This can get VERY large depending upon

/etc/make.conf.example:# or '--getbinpkgonly' will cause portage to retrieve the metadata from all

/etc/make.conf.example:# packages in the directory specified, and use that data to determine what will

/etc/make.conf.example:#     for all rapid operations such as lockfiles and transient data.

/etc/protocols:st       5       ST              # ST datagram mode

/etc/protocols:udp      17      UDP             # user datagram protocol

/etc/protocols:rdp      27      RDP             # "reliable datagram" protocol

/etc/security/limits.conf:#        - data - max data size (KB)

/etc/limits:# D: max data size (KB)

Binary file /etc/rmt matches

/etc/ssh/ssh_config:# Configuration data is parsed as follows:

/etc/dnsmasq.conf:dhcp-option=45,0.0.0.0     # netbios datagram distribution server

/etc/dnsmasq.conf:# The DHCP server needs somewhere on disk to keep its lease database.

/etc/smartd.conf:# automatic online data collection, automatic Attribute autosave, and

/etc/shorewall/shorewall.conf:#        1) Web browsers connect, then hang with no data received.

/etc/shorewall/tos:all  all             tcp             ftp-data        -               8

/etc/shorewall/tos:all  all             tcp             -               ftp-data        8

/etc/samba/smb.conf.example:# Samba now has runtime-configurable password database backends. Multiple

/etc/samba/smb.conf.example:# A private printer, usable only by Fred. Spool data will be placed in Fred's

/etc/fonts/fonts.conf:  the data found in the instructed hints.  The initial Vera release

/etc/fonts/fonts.dtd:    Global library configuration data

/etc/fonts/fonts.dtd:    data.  With this list, fontconfig can examine

/etc/dnsmasq.conf.orig:#dhcp-option=45,0.0.0.0     # netbios datagram distribution server

/etc/dnsmasq.conf.orig:# The DHCP server needs somewhere on disk to keep its lease database.

grenada / #

```

heres /etc/hosts (all of it)

```
grenada / # cat /etc/hosts

# /etc/hosts:  This file describes a number of hostname-to-address

#              mappings for the TCP/IP subsystem.  It is mostly

#              used at boot time, when no name servers are running.

#              On small systems, this file can be used instead of a

#              "named" name server.  Just add the names, addresses

#              and any aliases to this file...

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $

#

127.0.0.1       localhost

192.168.0.1     grenada.home.network grenada

# IPV6 versions of localhost and co

#::1 ip6-localhost ip6-loopback

#fe00::0 ip6-localnet

#ff00::0 ip6-mcastprefix

#ff02::1 ip6-allnodes

#ff02::2 ip6-allrouters

#ff02::3 ip6-allhosts

grenada / #                                                         
```

----------

## jmbsvicetto

 *thecooptoo wrote:*   

> ive removed all the stuff it fond in 
> 
> /etc/exim/*
> 
> etc/env.d/gcc/i686-pc-linux-gnu-3.3.6
> ...

 

I hope you've got copies, because you shouldn't remove it from those files. I was trying to find any file that made the association between data and the wrong IP. From your output, there is none!   :Rolling Eyes:  I'm getting out of ideas.

Do you have any more systems on your network? Do they have the same problem? Do you have this problem with any Windows systems? Do you have any wins line in /etc/samba/smb.conf?

----------

## thecooptoo

removed = deleted from the output . Files are still there though.

    nervada= another machine on the NW

```
nervada Application Data # dig data.home.network

; <<>> DiG 9.3.1 <<>> data.home.network

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42983

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;data.home.network.             IN      A

;; ANSWER SECTION:

data.home.network.      0       IN      A       192.168.0.8

;; Query time: 3 msec

;; SERVER: 192.168.0.1#53(192.168.0.1)

;; WHEN: Thu Oct 20 14:01:26 2005

;; MSG SIZE  rcvd: 51

nervada Application Data # ping -c1 data

PING data.home.network (192.168.0.8) 56(84) bytes of data.

64 bytes from data.home.network (192.168.0.8): icmp_seq=1 ttl=128 time=0.405 ms

--- data.home.network ping statistics ---

1 packets transmitted, 1 received, 0% packet loss, time 0ms

rtt min/avg/max/mdev = 0.405/0.405/0.405/0.000 ms

nervada Application Data #

```

grenada= server with the problem 

```

grenada / # dig data

; <<>> DiG 9.2.5 <<>> data

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48285

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;data.                          IN      A

;; ANSWER SECTION:

data.                   0       IN      A       192.168.0.8

;; Query time: 3 msec

;; SERVER: 192.168.0.1#53(192.168.0.1)

;; WHEN: Thu Oct 20 14:59:30 2005

;; MSG SIZE  rcvd: 38

grenada / # ping data

PING data.home.network (192.168.0.9) 56(84) bytes of data.

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=1 ttl=128 time=1.66 ms

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=2 ttl=128 time=2.10 ms

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=3 ttl=128 time=1.43 ms

^X64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=4 ttl=128 time=1.86 ms

64 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=5 ttl=128 time=1.46 ms

--- data.home.network ping statistics ---

5 packets transmitted, 5 received, 0% packet loss, time 4002ms

rtt min/avg/max/mdev = 1.438/1.707/2.105/0.254 ms

grenada / #

```

 from the server the lookup without the FQDN is OK but the ping without it is wrong.

The lookup (from a client  machine) and the ping is OK.

The lookup from the windows machine is OK ( cnat work out how to copy text with VNC from command.com box to local [/code]

----------

## jmbsvicetto

Well, I think you can definitely rule out a DNS problem at grenada.

I don't know how it will be doing it, but I'm pretty sure that you have a problem with files or, most likely, with WINS. I just can't tell how grenada is choosing to use a file or WINS, when the /etc/nsswitch.conf and /etc/hosts tell it otherwise. If you have a WINS server in the network, can you check what IP address is registered for data?

----------

## thecooptoo

AFAIK I havent got a WINS server - unless the winXP machine is acting as one by default . Nor sure how i show that .

----------

## jmbsvicetto

Well, if you only have WinXP and you didn't configure SAMBA to be a WINS server, then you don't have any WINS server on your network.

That's even more strange. If you don't have strace, please emerge it and then run the following

```
# strace ping -c 4 data
```

----------

## thecooptoo

```
grenada / # strace  ping -c4 data

execve("/bin/ping", ["ping", "-c4", "data"], [/* 31 vars */]) = 0

uname({sys="Linux", node="grenada", ...}) = 0

brk(0)                                  = 0x142c9ab0

access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY)      = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=21848, ...}) = 0

mmap2(NULL, 21848, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb2b95000

close(3)                                = 0

open("/lib/libresolv.so.2", O_RDONLY)   = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P&\0\000"..., 512) = 512

fstat64(3, {st_mode=S_IFREG|0755, st_size=69216, ...}) = 0

mmap2(NULL, 79892, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4547d000

mmap2(0x4548d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf) = 0x4548d000

mmap2(0x4548f000, 6164, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4548f000

close(3)                                = 0

open("/lib/libc.so.6", O_RDONLY)        = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340Q\1"..., 512) = 512

fstat64(3, {st_mode=S_IFREG|0755, st_size=1274184, ...}) = 0

mmap2(NULL, 1178684, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x45491000

mprotect(0x455aa000, 27708, PROT_NONE)  = 0

mmap2(0x455ab000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x119) = 0x455ab000

mmap2(0x455af000, 7228, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x455af000

close(3)                                = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb2b94000

mprotect(0x455ab000, 4096, PROT_READ)   = 0

mprotect(0x4547b000, 4096, PROT_READ)   = 0

set_thread_area({entry_number:-1 -> 6, base_addr:0xb2b94b60, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0

munmap(0xb2b95000, 21848)               = 0

open("/dev/urandom", O_RDONLY)          = 3

read(3, "I\210\35\274", 4)              = 4

close(3)                                = 0

socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3

getuid32()                              = 0

setuid32(0)                             = 0

brk(0)                                  = 0x142c9ab0

brk(0x142eaab0)                         = 0x142eaab0

brk(0x142eb000)                         = 0x142eb000

gettimeofday({1129994116, 590036}, NULL) = 0

getpid()                                = 415

open("/etc/resolv.conf", O_RDONLY)      = 4

fstat64(4, {st_mode=S_IFREG|0644, st_size=63, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb2b9a000

read(4, "nameserver 192.168.0.1\nsearch co"..., 4096) = 63

read(4, "", 4096)                       = 0

close(4)                                = 0

munmap(0xb2b9a000, 4096)                = 0

brk(0x142ea000)                         = 0x142ea000

socket(PF_FILE, SOCK_STREAM, 0)         = 4

fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)

fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0

poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1

writev(4, [{"\2\0\0\0\r\0\0\0\6\0\0\0", 12}, {"hosts\0", 6}], 2) = 18

poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1

recvmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"dX\27\262wN", 6}], msg_controllen=0, msg_flags=0}, 0) = 0

close(4)                                = 0

socket(PF_FILE, SOCK_STREAM, 0)         = 4

fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)

fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0

poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1

writev(4, [{"\2\0\0\0\4\0\0\0\5\0\0\0", 12}, {"data\0", 5}], 2) = 17

poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1

read(4, "\2\0\0\0\1\0\0\0\22\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\1\0\0"..., 32) = 32

readv(4, [{"data.home.network\0", 18}, {"\300\250\0\t", 4}], 2) = 22

read(4, NULL, 0)                        = 0

close(4)                                = 0

socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4

connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("192.168.0.9")}, 16) = 0

getsockname(4, {sa_family=AF_INET, sin_port=htons(32959), sin_addr=inet_addr("192.168.0.1")}, [16]) = 0

close(4)                                = 0

setsockopt(3, SOL_RAW, ICMP_FILTER, ~(ICMP_ECHOREPLY|ICMP_DEST_UNREACH|ICMP_SOURCE_QUENCH|ICMP_REDIRECT|ICMP_TIME_EXCEEDED|ICMP_PARAMETERPROB), 4) = 0

setsockopt(3, SOL_IP, IP_RECVERR, [1], 4) = 0

setsockopt(3, SOL_SOCKET, SO_SNDBUF, [324], 4) = 0

setsockopt(3, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0

getsockopt(3, SOL_SOCKET, SO_RCVBUF, [131072], [4]) = 0

fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb2b9a000

write(1, "PING data.home.network (192.168."..., 59PING data.home.network (192.168.0.9) 56(84) bytes of data.

) = 59

setsockopt(3, SOL_SOCKET, SO_TIMESTAMP, [1], 4) = 0

setsockopt(3, SOL_SOCKET, SO_SNDTIMEO, "\1\0\0\0\0\0\0\0", 8) = 0

setsockopt(3, SOL_SOCKET, SO_RCVTIMEO, "\1\0\0\0\0\0\0\0", 8) = 0

rt_sigaction(SIGINT, {0x142a29b0, [], SA_RESTORER|SA_INTERRUPT, 0x454b9b48}, NULL, 8) = 0

rt_sigaction(SIGALRM, {0x142a29b0, [], SA_RESTORER|SA_INTERRUPT, 0x454b9b48}, NULL, 8) = 0

rt_sigaction(SIGQUIT, {0x142a2a00, [], SA_RESTORER|SA_INTERRUPT, 0x454b9b48}, NULL, 8) = 0

gettimeofday({1129994116, 621079}, NULL) = 0

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0

ioctl(1, TIOCGWINSZ, {ws_row=54, ws_col=129, ws_xpixel=0, ws_ypixel=0}) = 0

gettimeofday({1129994116, 623179}, NULL) = 0

gettimeofday({1129994116, 623851}, NULL) = 0

sendmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"\10\0\232\332\237\1\0\1\204WZC\353\204\t\0\10\t\n\v\f\r"..., 64}], msg_controllen=0, msg_flags=0}, 0) = 64

recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(49364), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"E\0\0T\272\6@\0\200\1\277G\300\250\0\t\300\250\0\1\0\0"..., 192}], msg_controllen=20, {cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=0x1d /* SCM_??? */, ...}, msg_flags=0}, 0) = 84

socket(PF_FILE, SOCK_STREAM, 0)         = 4

fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)

fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0

poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1

writev(4, [{"\2\0\0\0\6\0\0\0\4\0\0\0", 12}, {"\300\250\0\t", 4}], 2) = 16

poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1

read(4, "\2\0\0\0\1\0\0\0\30\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\1\0\0"..., 32) = 32

readv(4, [{"DadsLapTop.home.network\0", 24}, {"\300\250\0\t", 4}], 2) = 28

read(4, NULL, 0)                        = 0

close(4)                                = 0

write(1, "64 bytes from DadsLapTop.home."..., 8564 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=1 ttl=128 time=2.99 ms

) = 85

gettimeofday({1129994116, 636700}, NULL) = 0

poll([{fd=3, events=POLLIN|POLLERR}], 1, 987) = 0

gettimeofday({1129994117, 625451}, NULL) = 0

gettimeofday({1129994117, 626174}, NULL) = 0

sendmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"\10\0\206\320\237\1\0\2\205WZC\376\215\t\0\10\t\n\v\f\r"..., 64}], msg_controllen=0, msg_flags=0}, MSG_CONFIRM) = 64

recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(49364), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"E\0\0T\272\7@\0\200\1\277F\300\250\0\t\300\250\0\1\0\0"..., 192}], msg_controllen=20, {cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=0x1d /* SCM_??? */, ...}, msg_flags=0}, 0) = 84

socket(PF_FILE, SOCK_STREAM, 0)         = 4

fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)

fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0

poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1

writev(4, [{"\2\0\0\0\6\0\0\0\4\0\0\0", 12}, {"\300\250\0\t", 4}], 2) = 16

poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1

read(4, "\2\0\0\0\1\0\0\0\30\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\1\0\0"..., 32) = 32

readv(4, [{"DadsLapTop.home.network\0", 24}, {"\300\250\0\t", 4}], 2) = 28

read(4, NULL, 0)                        = 0

close(4)                                = 0

write(1, "64 bytes from DadsLapTop.home."..., 8564 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=2 ttl=128 time=3.01 ms

) = 85

gettimeofday({1129994117, 638892}, NULL) = 0

poll([{fd=3, events=POLLIN|POLLERR}], 1, 987) = 0

gettimeofday({1129994118, 627249}, NULL) = 0

gettimeofday({1129994118, 627967}, NULL) = 0

sendmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"\10\0\204\310\237\1\0\3\206WZC\377\224\t\0\10\t\n\v\f\r"..., 64}], msg_controllen=0, msg_flags=0}, MSG_CONFIRM) = 64

recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(49364), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"E\0\0T\272\10@\0\200\1\277E\300\250\0\t\300\250\0\1\0\0"..., 192}], msg_controllen=20, {cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=0x1d /* SCM_??? */, ...}, msg_flags=0}, 0) = 84

socket(PF_FILE, SOCK_STREAM, 0)         = 4

fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)

fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0

poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1

writev(4, [{"\2\0\0\0\6\0\0\0\4\0\0\0", 12}, {"\300\250\0\t", 4}], 2) = 16

poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1

read(4, "\2\0\0\0\1\0\0\0\30\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\1\0\0"..., 32) = 32

readv(4, [{"DadsLapTop.home.network\0", 24}, {"\300\250\0\t", 4}], 2) = 28

read(4, NULL, 0)                        = 0

close(4)                                = 0

write(1, "64 bytes from DadsLapTop.home."..., 8564 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=3 ttl=128 time=2.86 ms

) = 85

gettimeofday({1129994118, 640927}, NULL) = 0

poll([{fd=3, events=POLLIN|POLLERR}], 1, 987) = 0

gettimeofday({1129994119, 630087}, NULL) = 0

gettimeofday({1129994119, 630814}, NULL) = 0

sendmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"\10\0d\274\237\1\0\4\207WZC\36\240\t\0\10\t\n\v\f\r\16"..., 64}], msg_controllen=0, msg_flags=0}, MSG_CONFIRM) = 64

setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={1, 0}}, NULL) = 0

recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(49364), sin_addr=inet_addr("192.168.0.9")}, msg_iov(1)=[{"E\0\0T\272\t@\0\200\1\277D\300\250\0\t\300\250\0\1\0\0"..., 192}], msg_controllen=20, {cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=0x1d /* SCM_??? */, ...}, msg_flags=0}, 0) = 84

socket(PF_FILE, SOCK_STREAM, 0)         = 4

fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)

fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0

poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1

writev(4, [{"\2\0\0\0\6\0\0\0\4\0\0\0", 12}, {"\300\250\0\t", 4}], 2) = 16

poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1

read(4, "\2\0\0\0\1\0\0\0\30\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\1\0\0"..., 32) = 32

readv(4, [{"DadsLapTop.home.network\0", 24}, {"\300\250\0\t", 4}], 2) = 28

read(4, NULL, 0)                        = 0

close(4)                                = 0

write(1, "64 bytes from DadsLapTop.home."..., 8564 bytes from DadsLapTop.home.network (192.168.0.9): icmp_seq=4 ttl=128 time=2.75 ms

) = 85

write(1, "\n", 1

)                       = 1

write(1, "--- data.home.network ping stati"..., 42--- data.home.network ping statistics ---

) = 42

write(1, "4 packets transmitted, 4 receive"..., 634 packets transmitted, 4 received, 0% packet loss, time 3009ms

) = 63

write(1, "rtt min/avg/max/mdev = 2.759/2.9"..., 50rtt min/avg/max/mdev = 2.759/2.907/3.010/0.109 ms

) = 50

munmap(0xb2b9a000, 4096)                = 0

exit_group(0)                           = ?

grenada / #   
```

----------

## jmbsvicetto

Ah, Ah!!!

It seems that nscd might be getting in the way.

Please do the following

```
# /etc/init.d/samba stop

# /etc/init.d/nscd stop

# arp -d data

# ping -c 4 data
```

If that works, then you'll need to look at the SAMBA and nscd config.

----------

## thecooptoo

 :Laughing:   :Laughing: 

```
grenada / # ping -c4 data

PING data.home.network (192.168.0.8) 56(84) bytes of data.

64 bytes from data.home.network (192.168.0.8): icmp_seq=1 ttl=128 time=1.12 ms

64 bytes from data.home.network (192.168.0.8): icmp_seq=2 ttl=128 time=0.428 ms

64 bytes from data.home.network (192.168.0.8): icmp_seq=3 ttl=128 time=0.446 ms

64 bytes from data.home.network (192.168.0.8): icmp_seq=4 ttl=128 time=0.410 ms

--- data.home.network ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3002ms

rtt min/avg/max/mdev = 0.410/0.602/1.126/0.303 ms

grenada / # ping -c4 data.home.network

PING data.home.network (192.168.0.8) 56(84) bytes of data.

64 bytes from data.home.network (192.168.0.8): icmp_seq=1 ttl=128 time=0.454 ms

64 bytes from data.home.network (192.168.0.8): icmp_seq=2 ttl=128 time=0.452 ms

64 bytes from data.home.network (192.168.0.8): icmp_seq=3 ttl=128 time=0.417 ms

--- data.home.network ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2001ms

rtt min/avg/max/mdev = 0.417/0.441/0.454/0.017 ms

grenada / #                                                                      
```

and once samba and nscd are restarted it works  correctly.

thanks very much 

Is there a brief explanation of whats been going on ?

----------

## jmbsvicetto

Well, nscd (network service cache daemon) is a way to cache name resolution. Once it started and your system resolved data to 192.168.0.9, it kept that association in cache. Until it restarted, it kept saying that data was 192.168.0.9, because it never confirmed that association. When it started again, it was forced to resolve the name again, and so it got the new IP address. When your computer addresses get updated, you should restart nscd to make it aware of the changes.

I'm sorry for not having thought on that before.  :Sad: 

----------

