Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-21-2014, 03:15 AM
|
#1
|
Member
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68
Rep:
|
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.
|
|
|
02-21-2014, 03:33 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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)
|
|
|
02-21-2014, 04:00 AM
|
#3
|
Member
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68
Original Poster
Rep:
|
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
|
|
|
02-21-2014, 02:05 PM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
02-21-2014, 02:24 PM
|
#5
|
Member
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68
Original Poster
Rep:
|
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
/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
/etc/hostname:
openfire2
|
|
|
|
02-26-2014, 09:37 AM
|
#6
|
Member
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68
Original Poster
Rep:
|
Anyone?
Is this such an obvious thing or just the opposite, something rare?
|
|
|
02-27-2014, 03:21 AM
|
#7
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
All times are GMT -5. The time now is 08:55 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|