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;








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.










share|improve this question







New contributor




Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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

















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.










share|improve this question







New contributor




Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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













0












0








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.










share|improve this question







New contributor




Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question







New contributor




Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 10 at 20:04









SiaSia

32




32




New contributor




Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Sia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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

















  • 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
















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










1 Answer
1






active

oldest

votes


















0














Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP






share|improve this answer








New contributor




AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Yep, that was it. Thank you!

    – Sia
    Apr 11 at 3:03











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.









draft saved

draft discarded


















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









0














Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP






share|improve this answer








New contributor




AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Yep, that was it. Thank you!

    – Sia
    Apr 11 at 3:03















0














Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP






share|improve this answer








New contributor




AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Yep, that was it. Thank you!

    – Sia
    Apr 11 at 3:03













0












0








0







Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP






share|improve this answer








New contributor




AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










Check /etc/hosts. Probably there's a line with the name of the server and an incorrect IP







share|improve this answer








New contributor




AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered Apr 10 at 20:51









AMJAMJ

161




161




New contributor




AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






AMJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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





Yep, that was it. Thank you!

– Sia
Apr 11 at 3:03










Sia is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In 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 ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.