LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-21-2014, 03:15 AM   #1
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Rep: Reputation: 20
Stuck with DNS client issue


Hi all,

For a test (openfire server) I have installed 2 virtual machines with wheezy.
This is how I configured them:
allow-hotplug eth0
iface eth0 inet static
address 172.16.0.45
netmask 255.255.255.0
gateway 172.16.0.1

/etc/resolv.conf:
domain home
search home
nameserver 172.16.0.1

/etc/hosts:
127.0.0.1 localhost
127.0.1.1 openfire2.home openfire2
172.16.0.47 openfire3.home

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

/etc/hostname:
openfire2

The second system with ip .47, openfire3 and the other way around in the hosts file.

Modem/router:
Primary DNS: server from my isp
Secondary DNS: openDNS server (208.67.222.222)

I get a reply when I ping both IP addresses but this when I ping the hostnames:
root@openfire3:~# ping openfire2
PING openfire2.home (67.215.65.132) 56(84) bytes of data.
From 172.16.0.47 icmp_seq=1 Destination Host Unreachable

Should it not work with my settings, regardless of my modem/router settings or what am I missing?
TIA
P.
 
Old 02-21-2014, 03:33 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this can not be anything to do with DNS at all. DNS has resolved the name to an IP and plays no further part once ping has the IP, can you show us the full ping output for working and non working scenarios? and after each, show us the arp cache on the box (arp -an)
 
Old 02-21-2014, 04:00 AM   #3
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
Hi Chris, thank you for stepping in!

From system 1 (172.16.0.45 | openfire2)
root@openfire2:~# ping -c4 172.16.0.47
Code:
PING 172.16.0.47 (172.16.0.47) 56(84) bytes of data.
64 bytes from 172.16.0.47: icmp_req=1 ttl=64 time=0.376 ms
64 bytes from 172.16.0.47: icmp_req=2 ttl=64 time=0.331 ms
64 bytes from 172.16.0.47: icmp_req=3 ttl=64 time=0.339 ms
64 bytes from 172.16.0.47: icmp_req=4 ttl=64 time=0.353 ms

--- 172.16.0.47 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 0.331/0.349/0.376/0.028 ms
root@openfire2:~# ping -c4 openfire3
Code:
PING openfire3.home (67.215.65.132) 56(84) bytes of data.
64 bytes from hit-nxdomain.opendns.com (67.215.65.132): icmp_req=1 ttl=54 time=30.6 ms
64 bytes from hit-nxdomain.opendns.com (67.215.65.132): icmp_req=2 ttl=54 time=31.1 ms
64 bytes from hit-nxdomain.opendns.com (67.215.65.132): icmp_req=3 ttl=54 time=30.5 ms
64 bytes from hit-nxdomain.opendns.com (67.215.65.132): icmp_req=4 ttl=54 time=32.4 ms

--- openfire3.home ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 30.587/31.221/32.432/0.735 ms
root@openfire2:~# arp -an
Code:
? (172.16.0.1) at c8:cd:72:34:c7:1c [ether] on eth0
? (172.16.0.10) at 00:18:f3:8a:7a:ea [ether] on eth0
? (172.16.0.47) at 00:0c:29:a4:4f:bb [ether] on eth0
From system 2 (172.16.0.47 | openfire3)
root@openfire3:~# ping -c4 172.16.0.45
Code:
PING 172.16.0.45 (172.16.0.45) 56(84) bytes of data.
64 bytes from 172.16.0.45: icmp_req=1 ttl=64 time=1.20 ms
64 bytes from 172.16.0.45: icmp_req=2 ttl=64 time=0.379 ms
64 bytes from 172.16.0.45: icmp_req=3 ttl=64 time=0.317 ms
64 bytes from 172.16.0.45: icmp_req=4 ttl=64 time=0.350 ms

--- 172.16.0.45 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 0.317/0.563/1.209/0.374 ms
root@openfire3:~# ping -c4 openfire2
Code:
PING openfire2.home (67.215.65.132) 56(84) bytes of data.
From 172.16.0.47 icmp_seq=1 Destination Host Unreachable
From 172.16.0.47 icmp_seq=2 Destination Host Unreachable
From 172.16.0.47 icmp_seq=3 Destination Host Unreachable
From 172.16.0.47 icmp_seq=4 Destination Host Unreachable

--- openfire2.home ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3201ms
pipe 3
root@openfire3:~# arp -an
Code:
? (172.16.0.254) at <incomplete> on eth0
? (172.16.0.1) at c8:cd:72:34:c7:1c [ether] on eth0
? (172.16.0.45) at 00:0c:29:76:54:b7 [ether] on eth0
? (172.16.0.10) at 00:18:f3:8a:7a:ea [ether] on eth0
 
Old 02-21-2014, 02:05 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
OK, so it looks like you're expecting DNS to work without having actually set anything up to do so. By default you can't just name a server and then ping it by that name from somewhere else, that's not how it works. you can clearly see the ping attempts you're doing with names are resolving to some remote public address, an address that is actually a fake response from opendns that says the host does not exist.

Add entries to the /etc/hosts files on the relevant systems, e.g. on openfire3:

172.16.0.45 openfire2

then try again.
 
Old 02-21-2014, 02:24 PM   #5
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
My knowledge of DNS isn't that good so I'm not sure if what I have is correct or very far off from your suggestion.
Quote:
Originally Posted by Peterken View Post
/etc/hosts:
127.0.0.1 localhost
127.0.1.1 openfire2.home openfire2
172.16.0.47 openfire3.home

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Isn't 127.0.1.1 openfire2.home openfire2 the same as 172.16.0.45 openfire2 ?

I also have struggled to find the right way to set the hostname and found different solutions for that. This is how it is now:
Quote:
Originally Posted by Peterken View Post
/etc/hostname:
openfire2
 
Old 02-26-2014, 09:37 AM   #6
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
Anyone?

Is this such an obvious thing or just the opposite, something rare?
 
Old 02-27-2014, 03:21 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
No, there's nothing "rare" here at all.

Presuming that that hosts file is on openfire2, then you should be able to ping "openfire3.home" but without searching for this "home" domain defined in /etc/resolv.conf, just plain "openfire3" won't match the host entry.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dns client cannot resolve on dns server jtvillegas Linux - Software 3 03-12-2016 04:30 PM
Issue configuring DNS Client? linuxunix Linux - Newbie 1 07-01-2012 09:45 PM
How to configure DNS Server & DNS Client in RHEL4 chanakkya Linux - Networking 1 07-05-2009 02:41 PM
DNS issue - DNS works perfect on server but not on any other computer jtneal Linux - Networking 3 03-15-2008 04:30 PM
Stuck for 2 weeks on diskless client french_hustler Linux - Networking 9 01-05-2007 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration