Hostname lookup (ping) hangs indefinitely











up vote
1
down vote

favorite
1












Normally if I try pinging an address it will either do so promptly or state that the host is unknown. On one machine however, it seems that trying to ping an unknown host will cause it to hang forever (greater than 15 minutes).



This seems to causing problem in the boot process, hanging when trying to start sendmail services and so on.



Booting in single user mode, the only time ping responds is when pinging one of the hosts listed in /etc/hosts. Otherwise it will hang.



On the other hand, nslookup does seem to timeout after approx. 15 seconds.



ETA This seems to only happen in Single user mode. Once booted up normally (although had to disable SMB and sendmail services to do so) ping now times out if given an invalid name (like 'cabbage')



The 'host' command seems to return the following regardless if given a valid hostname or not;



(hostname).(domain name) mail is handled by 5 smtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 cinsmtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 alpsmtp01.(company domain name).


IIRC it was doing this in both the single boot mode and when booted normally and wasn't hanging. I'll confirm if I get a chance to reboot the machine again.



This is the only CentOS box on our local network - all others are Windows machines so can't really compare against a working machine. But below is a result of grep hosts /etc/nsswitch.conf



#hosts:     db files nisplus nis dns
hosts: db files wins nisplus nis dns


The resolv.conf has a number of nameserver entries in it, some of which may not be valid anymore, I'll investigate further and report back.










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • For an example target host name of cabbage, what does host cabbage return in your situation? Does it return or hang? Please also add output of grep hosts /etc/nsswitch.conf and cat /etc/resolv.conf to your question. And identify to us whether these match similar results from a working server.
    – roaima
    Oct 26 '16 at 17:21

















up vote
1
down vote

favorite
1












Normally if I try pinging an address it will either do so promptly or state that the host is unknown. On one machine however, it seems that trying to ping an unknown host will cause it to hang forever (greater than 15 minutes).



This seems to causing problem in the boot process, hanging when trying to start sendmail services and so on.



Booting in single user mode, the only time ping responds is when pinging one of the hosts listed in /etc/hosts. Otherwise it will hang.



On the other hand, nslookup does seem to timeout after approx. 15 seconds.



ETA This seems to only happen in Single user mode. Once booted up normally (although had to disable SMB and sendmail services to do so) ping now times out if given an invalid name (like 'cabbage')



The 'host' command seems to return the following regardless if given a valid hostname or not;



(hostname).(domain name) mail is handled by 5 smtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 cinsmtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 alpsmtp01.(company domain name).


IIRC it was doing this in both the single boot mode and when booted normally and wasn't hanging. I'll confirm if I get a chance to reboot the machine again.



This is the only CentOS box on our local network - all others are Windows machines so can't really compare against a working machine. But below is a result of grep hosts /etc/nsswitch.conf



#hosts:     db files nisplus nis dns
hosts: db files wins nisplus nis dns


The resolv.conf has a number of nameserver entries in it, some of which may not be valid anymore, I'll investigate further and report back.










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • For an example target host name of cabbage, what does host cabbage return in your situation? Does it return or hang? Please also add output of grep hosts /etc/nsswitch.conf and cat /etc/resolv.conf to your question. And identify to us whether these match similar results from a working server.
    – roaima
    Oct 26 '16 at 17:21















up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





Normally if I try pinging an address it will either do so promptly or state that the host is unknown. On one machine however, it seems that trying to ping an unknown host will cause it to hang forever (greater than 15 minutes).



This seems to causing problem in the boot process, hanging when trying to start sendmail services and so on.



Booting in single user mode, the only time ping responds is when pinging one of the hosts listed in /etc/hosts. Otherwise it will hang.



On the other hand, nslookup does seem to timeout after approx. 15 seconds.



ETA This seems to only happen in Single user mode. Once booted up normally (although had to disable SMB and sendmail services to do so) ping now times out if given an invalid name (like 'cabbage')



The 'host' command seems to return the following regardless if given a valid hostname or not;



(hostname).(domain name) mail is handled by 5 smtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 cinsmtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 alpsmtp01.(company domain name).


IIRC it was doing this in both the single boot mode and when booted normally and wasn't hanging. I'll confirm if I get a chance to reboot the machine again.



This is the only CentOS box on our local network - all others are Windows machines so can't really compare against a working machine. But below is a result of grep hosts /etc/nsswitch.conf



#hosts:     db files nisplus nis dns
hosts: db files wins nisplus nis dns


The resolv.conf has a number of nameserver entries in it, some of which may not be valid anymore, I'll investigate further and report back.










share|improve this question















Normally if I try pinging an address it will either do so promptly or state that the host is unknown. On one machine however, it seems that trying to ping an unknown host will cause it to hang forever (greater than 15 minutes).



This seems to causing problem in the boot process, hanging when trying to start sendmail services and so on.



Booting in single user mode, the only time ping responds is when pinging one of the hosts listed in /etc/hosts. Otherwise it will hang.



On the other hand, nslookup does seem to timeout after approx. 15 seconds.



ETA This seems to only happen in Single user mode. Once booted up normally (although had to disable SMB and sendmail services to do so) ping now times out if given an invalid name (like 'cabbage')



The 'host' command seems to return the following regardless if given a valid hostname or not;



(hostname).(domain name) mail is handled by 5 smtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 cinsmtp01.(company domain name).
(hostname).(domain name) mail is handled by 9 alpsmtp01.(company domain name).


IIRC it was doing this in both the single boot mode and when booted normally and wasn't hanging. I'll confirm if I get a chance to reboot the machine again.



This is the only CentOS box on our local network - all others are Windows machines so can't really compare against a working machine. But below is a result of grep hosts /etc/nsswitch.conf



#hosts:     db files nisplus nis dns
hosts: db files wins nisplus nis dns


The resolv.conf has a number of nameserver entries in it, some of which may not be valid anymore, I'll investigate further and report back.







centos dns ping






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 27 '16 at 11:03

























asked Oct 26 '16 at 16:01









MJF

12315




12315





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • For an example target host name of cabbage, what does host cabbage return in your situation? Does it return or hang? Please also add output of grep hosts /etc/nsswitch.conf and cat /etc/resolv.conf to your question. And identify to us whether these match similar results from a working server.
    – roaima
    Oct 26 '16 at 17:21




















  • For an example target host name of cabbage, what does host cabbage return in your situation? Does it return or hang? Please also add output of grep hosts /etc/nsswitch.conf and cat /etc/resolv.conf to your question. And identify to us whether these match similar results from a working server.
    – roaima
    Oct 26 '16 at 17:21


















For an example target host name of cabbage, what does host cabbage return in your situation? Does it return or hang? Please also add output of grep hosts /etc/nsswitch.conf and cat /etc/resolv.conf to your question. And identify to us whether these match similar results from a working server.
– roaima
Oct 26 '16 at 17:21






For an example target host name of cabbage, what does host cabbage return in your situation? Does it return or hang? Please also add output of grep hosts /etc/nsswitch.conf and cat /etc/resolv.conf to your question. And identify to us whether these match similar results from a working server.
– roaima
Oct 26 '16 at 17:21












1 Answer
1






active

oldest

votes

















up vote
0
down vote













If you're truly just doing it for the purpose of a hostname lookup, use the host command instead. That's its purpose.



Firewalls are often configured to drop ICMP packets. If this is the case, your ping will never get a reply (even if the host is up), and will just keep sending packets in to a black hole that never responds.



host will usually respond quickly with an IP (or not) whether the remote host exists or not, or is configured to drop packets or not. And if the command takes to long for your tastes, you can configure the timeout with the -W option.






share|improve this answer





















  • even if ICMP are blocked, the resolution is supposed to happen. The OP is having DNS configuration problems.
    – Rui F Ribeiro
    Feb 10 at 10:07











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f319110%2fhostname-lookup-ping-hangs-indefinitely%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








up vote
0
down vote













If you're truly just doing it for the purpose of a hostname lookup, use the host command instead. That's its purpose.



Firewalls are often configured to drop ICMP packets. If this is the case, your ping will never get a reply (even if the host is up), and will just keep sending packets in to a black hole that never responds.



host will usually respond quickly with an IP (or not) whether the remote host exists or not, or is configured to drop packets or not. And if the command takes to long for your tastes, you can configure the timeout with the -W option.






share|improve this answer





















  • even if ICMP are blocked, the resolution is supposed to happen. The OP is having DNS configuration problems.
    – Rui F Ribeiro
    Feb 10 at 10:07















up vote
0
down vote













If you're truly just doing it for the purpose of a hostname lookup, use the host command instead. That's its purpose.



Firewalls are often configured to drop ICMP packets. If this is the case, your ping will never get a reply (even if the host is up), and will just keep sending packets in to a black hole that never responds.



host will usually respond quickly with an IP (or not) whether the remote host exists or not, or is configured to drop packets or not. And if the command takes to long for your tastes, you can configure the timeout with the -W option.






share|improve this answer





















  • even if ICMP are blocked, the resolution is supposed to happen. The OP is having DNS configuration problems.
    – Rui F Ribeiro
    Feb 10 at 10:07













up vote
0
down vote










up vote
0
down vote









If you're truly just doing it for the purpose of a hostname lookup, use the host command instead. That's its purpose.



Firewalls are often configured to drop ICMP packets. If this is the case, your ping will never get a reply (even if the host is up), and will just keep sending packets in to a black hole that never responds.



host will usually respond quickly with an IP (or not) whether the remote host exists or not, or is configured to drop packets or not. And if the command takes to long for your tastes, you can configure the timeout with the -W option.






share|improve this answer












If you're truly just doing it for the purpose of a hostname lookup, use the host command instead. That's its purpose.



Firewalls are often configured to drop ICMP packets. If this is the case, your ping will never get a reply (even if the host is up), and will just keep sending packets in to a black hole that never responds.



host will usually respond quickly with an IP (or not) whether the remote host exists or not, or is configured to drop packets or not. And if the command takes to long for your tastes, you can configure the timeout with the -W option.







share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 26 '16 at 19:01









Dale Anderson

31118




31118












  • even if ICMP are blocked, the resolution is supposed to happen. The OP is having DNS configuration problems.
    – Rui F Ribeiro
    Feb 10 at 10:07


















  • even if ICMP are blocked, the resolution is supposed to happen. The OP is having DNS configuration problems.
    – Rui F Ribeiro
    Feb 10 at 10:07
















even if ICMP are blocked, the resolution is supposed to happen. The OP is having DNS configuration problems.
– Rui F Ribeiro
Feb 10 at 10:07




even if ICMP are blocked, the resolution is supposed to happen. The OP is having DNS configuration problems.
– Rui F Ribeiro
Feb 10 at 10:07


















draft saved

draft discarded




















































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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f319110%2fhostname-lookup-ping-hangs-indefinitely%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

サソリ

広島県道265号伴広島線

Setup Asymptote in Texstudio