From server cannot ping server itself by its hostname while can ping by its IP Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionUsing ip addr instead of ifconfig reports “RTNETLINK answers: File exists” on DebianLinux Container LXC Intra Host Networking Issuescan ping google dns, but not google.de -> unknown host // worked in another networkCan't enable net.ipv6.conf.eth0.autoconfLinux server able to wget but not able to pingUbuntu 15.10 Network Interfaces NameCan not set static DNS on debianHow can I forward traffic across two Ethernet cards?Debian8 server : Can't resolve IP adresses or DNSDirect connection Centos7 (loadbalance) to QNAP (trunk)
What is the largest species of polychaete?
How can I make names more distinctive without making them longer?
Stars Make Stars
I'm thinking of a number
Are my PIs rude or am I just being too sensitive?
What are the performance impacts of 'functional' Rust?
Is there folklore associating late breastfeeding with low intelligence and/or gullibility?
I'm having difficulty getting my players to do stuff in a sandbox campaign
Direct Experience of Meditation
Windows 10: How to Lock (not sleep) laptop on lid close?
Is there a documented rationale why the House Ways and Means chairman can demand tax info?
How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time
The following signatures were invalid: EXPKEYSIG 1397BC53640DB551
Can the prologue be the backstory of your main character?
Mortgage adviser recommends a longer term than necessary combined with overpayments
Need a suitable toxic chemical for a murder plot in my novel
Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?
What's the point in a preamp?
Determine whether f is a function, an injection, a surjection
What would be Julian Assange's expected punishment, on the current English criminal law?
How should I respond to a player wanting to catch a sword between their hands?
Aligning matrix of nodes with grid
Who can trigger ship-wide alerts in Star Trek?
How did the aliens keep their waters separated?
From server cannot ping server itself by its hostname while can ping by its IP
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionUsing ip addr instead of ifconfig reports “RTNETLINK answers: File exists” on DebianLinux Container LXC Intra Host Networking Issuescan ping google dns, but not google.de -> unknown host // worked in another networkCan't enable net.ipv6.conf.eth0.autoconfLinux server able to wget but not able to pingUbuntu 15.10 Network Interfaces NameCan not set static DNS on debianHow can I forward traffic across two Ethernet cards?Debian8 server : Can't resolve IP adresses or DNSDirect connection Centos7 (loadbalance) to QNAP (trunk)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
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.
ubuntu networking ping hostname resolv.conf
New contributor
add a comment |
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.
ubuntu networking ping hostname resolv.conf
New contributor
Just put your servers IP + the hostname(s) into your/etc/hosts
file.x.x.x.x somehostname.com hostname
– Michael D.
Apr 10 at 20:48
When you run theping
command, what IP address does it say it’s using?
– G-Man
Apr 10 at 20:56
@G-Man ping stalls.
– Sia
Apr 11 at 3:05
@Michael D, that worked, thank you! Wondering how come I did not need it before.
– Sia
Apr 11 at 3:05
add a comment |
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.
ubuntu networking ping hostname resolv.conf
New contributor
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.
ubuntu networking ping hostname resolv.conf
ubuntu networking ping hostname resolv.conf
New contributor
New contributor
New contributor
asked Apr 10 at 20:04
SiaSia
32
32
New contributor
New contributor
Just put your servers IP + the hostname(s) into your/etc/hosts
file.x.x.x.x somehostname.com hostname
– Michael D.
Apr 10 at 20:48
When you run theping
command, what IP address does it say it’s using?
– G-Man
Apr 10 at 20:56
@G-Man ping stalls.
– Sia
Apr 11 at 3:05
@Michael D, that worked, thank you! Wondering how come I did not need it before.
– Sia
Apr 11 at 3:05
add a comment |
Just put your servers IP + the hostname(s) into your/etc/hosts
file.x.x.x.x somehostname.com hostname
– Michael D.
Apr 10 at 20:48
When you run theping
command, what IP address does it say it’s using?
– G-Man
Apr 10 at 20:56
@G-Man ping stalls.
– Sia
Apr 11 at 3:05
@Michael D, that worked, thank you! Wondering how come I did not need it before.
– Sia
Apr 11 at 3:05
Just put your servers IP + the hostname(s) into your
/etc/hosts
file. x.x.x.x somehostname.com hostname
– Michael D.
Apr 10 at 20:48
Just put your servers IP + the hostname(s) into your
/etc/hosts
file. x.x.x.x somehostname.com hostname
– Michael D.
Apr 10 at 20:48
When you run the
ping
command, what IP address does it say it’s using?– G-Man
Apr 10 at 20:56
When you run the
ping
command, what IP address does it say it’s using?– G-Man
Apr 10 at 20:56
@G-Man ping stalls.
– Sia
Apr 11 at 3:05
@G-Man ping stalls.
– Sia
Apr 11 at 3:05
@Michael D, that worked, thank you! Wondering how come I did not need it before.
– Sia
Apr 11 at 3:05
@Michael D, that worked, thank you! Wondering how come I did not need it before.
– Sia
Apr 11 at 3:05
add a comment |
1 Answer
1
active
oldest
votes
Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP
New contributor
Yep, that was it. Thank you!
– Sia
Apr 11 at 3:03
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sia is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511749%2ffrom-server-cannot-ping-server-itself-by-its-hostname-while-can-ping-by-its-ip%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP
New contributor
Yep, that was it. Thank you!
– Sia
Apr 11 at 3:03
add a comment |
Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP
New contributor
Yep, that was it. Thank you!
– Sia
Apr 11 at 3:03
add a comment |
Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP
New contributor
Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP
New contributor
New contributor
answered Apr 10 at 20:51
AMJAMJ
161
161
New contributor
New contributor
Yep, that was it. Thank you!
– Sia
Apr 11 at 3:03
add a comment |
Yep, that was it. Thank you!
– Sia
Apr 11 at 3:03
Yep, that was it. Thank you!
– Sia
Apr 11 at 3:03
Yep, that was it. Thank you!
– Sia
Apr 11 at 3:03
add a comment |
Sia is a new contributor. Be nice, and check out our Code of Conduct.
Sia is a new contributor. Be nice, and check out our Code of Conduct.
Sia is a new contributor. Be nice, and check out our Code of Conduct.
Sia is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511749%2ffrom-server-cannot-ping-server-itself-by-its-hostname-while-can-ping-by-its-ip%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Just put your servers IP + the hostname(s) into your
/etc/hosts
file.x.x.x.x somehostname.com hostname
– Michael D.
Apr 10 at 20:48
When you run the
ping
command, what IP address does it say it’s using?– G-Man
Apr 10 at 20:56
@G-Man ping stalls.
– Sia
Apr 11 at 3:05
@Michael D, that worked, thank you! Wondering how come I did not need it before.
– Sia
Apr 11 at 3:05