I host an ubuntu server at a data center and worked well for years till last night the server can not ping itself by host name. No config has been changed. Here are what it can/can not do now.
- From outside, I can ping the server both by its static IP, and by its hostname.
- From server, I can ping any website (google, yahoo, ...).
- From server, I can ping localhost, and can ping the IP of server itself.
- From server, I can not ping sever itself by its hostname.
Here is /etc/network/interfaces
:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto enp5s0
iface enp5s0 inet static
address xxx.xxx.xxx.134
netmask 255.255.255.128
broadcast xxx.xxx.xxx.255
gateway xxx.xxx.xxx.129
dns-nameservers 192.168.1.1 8.8.8.8 8.8.4.4
and /etc/resolv.conf
:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
and /etc/resolvconf/resolv.conf.d/head
:
nameserver 8.8.8.8
nameserver 8.8.4.4
and the output of route -n
is:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 xxx.xxx.xxx.129 0.0.0.0 UG 0 0 0 enp5s0
xxx.xxx.xxx.128 0.0.0.0 255.255.255.128 U 0 0 0 enp5s0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
These configs worked for years. Wondering what happened? Thanks.
/etc/hosts
file.x.x.x.x somehostname.com hostname
ping
command, what IP address does it say it’s using?