Hi,

I have 2 machines on my network and a router.
my router is and my machines are:
darkstar (Ubuntu)
dazlaptop (WXP)

These two machines share files and work, and when i am in windows XP i can go to the folder directory \\darkstar\ and it opens.

But when i type ping darkstar it says this:
Pinging darkstar [] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

This is stupid because i can ping darkstar () and it works.

But i cant use the hostname.

So i tried flushing the dns.
ipconfig /flushdns

and it still does the same thing, I have no idea where it got this 172 B class network address from.

If I try it vice versa it still wont ping.

daz@darkstar:~$ ping dazlaptop
^C
daz@darkstar:~$ ping
PING () 56(84) bytes of data.
64 bytes from 192.168.1.16: icmp_seq=1 ttl=128 time=1.48 ms
64 bytes from 192.168.1.16: icmp_seq=2 ttl=128 time=1.23 ms
^C
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.231/1.355/1.480/0.129 ms

So it works Via IP, and for some reason samba works fine, but I have no clue why it wont let me flush the dns and let me use the hostname.

Also it only does this sometimes after the machines have been restarted.

Any ideaS?

Dani AI

Generated

This is a name‑resolution mismatch rather than a connectivity problem. SMB browsing (the UNC path that works) uses LAN name services (NetBIOS/WINS or local broadcasts / mDNS), while the ordinary hostname lookup that ping uses can come from DNS or a cached resolver entry. The occasional resolution to 172.16.142.1 strongly suggests a stale/alternate registration (often a VPN or virtual adapter, or a leftover DNS/WINS cache) that sometimes “wins” when the machines start.

Useful checks to identify the source and type of resolution:

Windows
nslookup darkstar
nbtstat -a darkstar
nbtstat -c
arp -a
ipconfig /all

Linux
getent hosts darkstar
nmblookup darkstar
ip addr show
cat /etc/nsswitch.conf

What to look for in the outputs

  • If nslookup returns 172.16.142.1, DNS is serving the wrong address.
  • If nbtstat shows the wrong IP, NetBIOS/WINS or a local name cache is stale.
  • arp -a and adapter listings reveal which device (or virtual/VPN adapter) actually owns that IP.

Fixes, from quick to robust

  • Quick: add a static hosts entry on each machine (what suggested) for reliability on a tiny LAN. already pointed out where Windows keeps that file.
  • Immediate cleanup: flush the offending name caches (NetBIOS/DNS) and disable any unnecessary virtual/VPN adapters that are advertising the same hostname.
  • Proper fix: have one authoritative local name service—either enable router/DHCP name registration, run a small WINS/DNS on the LAN (Samba can act as WINS), or use mDNS/Avahi consistently—so every client resolves the same IP.

Because this happens intermittently after restarts, start by checking for duplicate hostname registrations on multiple adapters; that is the most common root cause.

Recommended Answers

All 4 Replies

You have no common DNS server to translate the name. It may be possible to add the IPs to the individual hosts file on each PC if you really need to use names. If you are just mapping you can use the IP\share....

Hi,

I have 2 machines on my network and a router.
my router is and my machines are:
darkstar (Ubuntu)
dazlaptop (WXP)

These two machines share files and work, and when i am in windows XP i can go to the folder directory \\darkstar\ and it opens.

But when i type ping darkstar it says this:
Pinging darkstar [] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

This is stupid because i can ping darkstar () and it works.

But i cant use the hostname.

So i tried flushing the dns.
ipconfig /flushdns

and it still does the same thing, I have no idea where it got this 172 B class network address from.

If I try it vice versa it still wont ping.

daz@darkstar:~$ ping dazlaptop
^C
daz@darkstar:~$ ping
PING () 56(84) bytes of data.
64 bytes from 192.168.1.16: icmp_seq=1 ttl=128 time=1.48 ms
64 bytes from 192.168.1.16: icmp_seq=2 ttl=128 time=1.23 ms
^C
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.231/1.355/1.480/0.129 ms

So it works Via IP, and for some reason samba works fine, but I have no clue why it wont let me flush the dns and let me use the hostname.

Also it only does this sometimes after the machines have been restarted.

Any ideaS?

You have no common DNS server to translate the name. It may be possible to add the IPs to the individual hosts file on each PC if you really need to use names. If you are just mapping you can use the IP\share....

I dont mind, i know how to add it to the linux one /etc/hosts but how do you add it in windows?

In the case of Windows XP is usually located under the C:windows system32driversetc folder

The windows host file is located in %systemroot%\system32\drivers\etc which translates to C:\WINDOWS\system32\drivers\etc\hosts on 32bit versions of windows.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.