You are not logged in.

#1 2017-02-05 08:25:12

amitoj
Member
Registered: 2015-01-12
Posts: 9

[CLOSED] Ping by IP works but not via hostname

I have a hosted virtual server and I'm able to ssh into it. But for unknown reasons, "outgoing" connections from this server fail. `host` and `nslookup` commands work well. I can even ping via IP, but ping via hostname fails.

[root@li863-18 /]# nslookup google.com
Server:         139.162.27.5
Address:        139.162.27.5#53

Non-authoritative answer:
Name:   google.com
Address: 74.125.200.100
Name:   google.com
Address: 74.125.200.113
Name:   google.com
Address: 74.125.200.102
Name:   google.com
Address: 74.125.200.101
Name:   google.com
Address: 74.125.200.138
Name:   google.com
Address: 74.125.200.139
Name:   google.com
Address: 2404:6800:4003:c00::64

[root@li863-18 /]# ping 74.125.200.100
PING 74.125.200.100 (74.125.200.100) 56(84) bytes of data.
64 bytes from 74.125.200.100: icmp_seq=1 ttl=50 time=1.70 ms
64 bytes from 74.125.200.100: icmp_seq=2 ttl=50 time=1.69 ms
64 bytes from 74.125.200.100: icmp_seq=3 ttl=50 time=1.66 ms
^C
--- 74.125.200.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.661/1.687/1.706/0.038 ms
[root@li863-18 /]# ping google.com
PING google.com(sc-in-x64.1e100.net (2404:6800:4003:c02::64)) 56 data bytes
^C
--- google.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4062ms

Some Googling suggests that there may be a problem with "/etc/nsswitch.conf" file. Here are its contents:

# Begin /etc/nsswitch.conf

passwd: compat mymachines systemd
group: compat mymachines systemd
shadow: compat

publickey: files

hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

# End /etc/nsswitch.conf

I'm not sure which way should I start debugging.

Last edited by amitoj (2017-02-05 09:06:43)

Offline

#2 2017-02-05 09:06:17

amitoj
Member
Registered: 2015-01-12
Posts: 9

Re: [CLOSED] Ping by IP works but not via hostname

The problem was not with hostname but with IPv6 addresses. Closing this question and starting a new one.

Offline

#3 2017-02-05 15:51:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,785

Re: [CLOSED] Ping by IP works but not via hostname

amitoj wrote:

The problem was not with hostname but with IPv6 addresses. Closing this question and starting a new one.

https://bbs.archlinux.org/viewtopic.php?id=222785
Closed (for real)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB