[opensuse] Ping not working
I have a strange problem when pinging a few machines on various iterations of opensuse / ubuntu. I wanted to ping a computer on my lan e.g. ping paul-pc which returned: ping: paul-pc: Name or service not known so I then ran: nslookup paul-pc which returned the correct IP of paul-pc I am also unable to ssh to the hostname but I can using the IP. any idea why? I am confused because I can ping and ssh other devices on the same network without issue. the computer I am ping-ing from is a static IPv4 address here is it's config file /etc/network/interfaces # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto enp0s3 iface enp0s3 inet static address 192.168.0.20 netmask 255.255.255.0 gateway 192.168.0.1 network 192.168.0.0 #secondary DNS disabled for troubleshooting dns-nameservers 192.168.0.4 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Paul Groves composed on 2017-08-22 19:13 (UTC+0100):
I have a strange problem when pinging a few machines on various iterations of opensuse / ubuntu.
I wanted to ping a computer on my lan e.g. ping paul-pc
which returned: ping: paul-pc: Name or service not known
so I then ran: nslookup paul-pc
which returned the correct IP of paul-pc
I am also unable to ssh to the hostname but I can using the IP.
any idea why?
I am confused because I can ping and ssh other devices on the same network without issue.
the computer I am ping-ing from is a static IPv4 address here is it's config file /etc/network/interfaces
# The loopback network interface auto lo iface lo inet loopback
# The primary network interface auto enp0s3 iface enp0s3 inet static address 192.168.0.20 netmask 255.255.255.0 gateway 192.168.0.1 network 192.168.0.0 #secondary DNS disabled for troubleshooting dns-nameservers 192.168.0.4
Which openSUSE is yours? Is NetworkManager installed? (not here) Does /etc/sysconfig/network/routes exist? If so, what's in it? (here, one line setting default) My (fixed IP) primary interface file only has 3 lines in it: BOOTPROTO='static', STARTMODE='auto' and IPADDR=.... -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Paul Groves wrote:
I have a strange problem when pinging a few machines on various iterations of opensuse / ubuntu.
I wanted to ping a computer on my lan e.g. ping paul-pc
which returned: ping: paul-pc: Name or service not known
so I then ran: nslookup paul-pc
which returned the correct IP of paul-pc
I am also unable to ssh to the hostname but I can using the IP.
any idea why?
It must be a DNS issue.
I am confused because I can ping and ssh other devices on the same network without issue.
Right, so your network is fine, the issue is in resolving names to address, i.e. DNS. To start with, please post the contents of /etc/resolv.conf. which domain name are you using? -- Per Jessen, Zürich (16.9°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Отправлено с iPhone
23 авг. 2017 г., в 8:46, Per Jessen
написал(а): Paul Groves wrote:
I have a strange problem when pinging a few machines on various iterations of opensuse / ubuntu.
I wanted to ping a computer on my lan e.g. ping paul-pc
which returned: ping: paul-pc: Name or service not known
so I then ran: nslookup paul-pc
which returned the correct IP of paul-pc
I am also unable to ssh to the hostname but I can using the IP.
any idea why?
It must be a DNS issue.
I am confused because I can ping and ssh other devices on the same network without issue.
Right, so your network is fine, the issue is in resolving names to address, i.e. DNS.
To start with, please post the contents of /etc/resolv.conf. which domain name are you using?
As nslookup works, this file is probably OK. But /etc/nsswitch.conf would be interesting.
-- Per Jessen, Zürich (16.9°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 23/08/17 13:02, Andrei Borzenkov wrote:
23 авг. 2017 г., в 8:46, Per Jessen
написал(а): Paul Groves wrote:
I have a strange problem when pinging a few machines on various iterations of opensuse / ubuntu.
I wanted to ping a computer on my lan e.g. ping paul-pc
which returned: ping: paul-pc: Name or service not known
so I then ran: nslookup paul-pc
which returned the correct IP of paul-pc
I am also unable to ssh to the hostname but I can using the IP.
any idea why? It must be a DNS issue.
I am confused because I can ping and ssh other devices on the same network without issue. Right, so your network is fine, the issue is in resolving names to address, i.e. DNS.
To start with, please post the contents of /etc/resolv.conf. which domain name are you using?
Here is the resov.conf file paul@suseserver:~$ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers. nameserver 192.168.0.4 nameserver 127.0.0.53
As nslookup works, this file is probably OK. But /etc/nsswitch.conf would be interesting. here is the nsswitch file
paul@suseserver:~$ cat /etc/nsswitch.conf # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat group: compat shadow: compat gshadow: files hosts: files resolve [!UNAVAIL=return] dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-08-23 15:13, Paul Groves wrote:
On 23/08/17 13:02, Andrei Borzenkov wrote:
23 авг. 2017 г., в 8:46, Per Jessen <> написал(а):
any idea why? It must be a DNS issue.
paul@suseserver:~$ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 192.168.0.4 nameserver 127.0.0.53
try: host paul-pc 192.168.0.4 host paul-pc 127.0.0.53 If the answer is not correct in one of them, you may have to take it up with the DNS admin :-)
paul@suseserver:~$ cat /etc/nsswitch.conf
hosts: files resolve [!UNAVAIL=return] dns networks: files
-- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On 23/08/17 16:26, Carlos E. R. wrote:
try: host paul-pc 192.168.0.4 host paul-pc 127.0.0.53
If the answer is not correct in one of them, you may have to take it up with the DNS admin:-) Ta da! it works. It was a silly cause (as always).
Ignore 127.0.0.53 because it is the system resolve address and is supposed to be there. I was missing dns-search in my /etc/network/interfaces file (see below). auto enp0s3 iface enp0s3 inet static address 192.168.0.20 netmask 255.255.255.0 gateway 192.168.0.1 network 192.168.0.0 dns-nameservers 192.168.0.4 dns-search domainname Where domain.net is my domain name (not really but you get it). I don't know why it only affected the one server but I have added the dns-search line onto all of them and they still work fine. So now I can ping paul-pc and I get the correct IP address back. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Andrei Borzenkov
-
Carlos E. R.
-
Felix Miata
-
Paul Groves
-
Per Jessen