Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Can't ping machine by name, even though the names are explicitly defined in Hosts file

Dear Experts,

Sorry for throwing out this question, but I just can't quite understand why my computer cannot resolve computer names, even though I set them in the hosts file.  I am setting up a monitoring tools on a server, to perform different kinds of tests (ping, url check, crc, memory available ...etc) on selected servers.  Along those tests, I make the monitoring machine to test other servers by using computer name.  I made a list of computer names along with their IPs in the C:\windows\system32\drivers\etc\hosts table, But for some reasons, some Windows computers can be ping by using computer name.  But for linux machines, URLs (eg. ns1.yahoo.com), windows machines on the other geograpic location could not be resolved.

As I understand (please correct me if I am wrong), when I send a command like "Ping Server1", it will try to lookup the name "server1" by hosts table, then if that doesnt' resolve, it'll check the DNS... is there any other that would take precedence of the hosts table?  

any thing that I might did wrong?  thanks.



0
wingkchan
Asked:
wingkchan
  • 3
  • 2
1 Solution
 
KaddictCommented:
If most of your machines answer to ping, isn't it a firewall blocking ping on those which does not work ?

When you ping, first line looks like : Sending ping to server-name [xx.xx.xx.xx]   <=== do you see the IP and it does not answer, or you see no IP at all?
0
 
wingkchanAuthor Commented:
Kaddict, thank you for the lightening reply.  Most computers are within the network, and previously we have another monitoring machine that can do those ping tests... so I think that might not be the firewall issue.

When I execute: "ping server-anme", it returns the following:
Ping request could not find host server-name, please check the name and try again
0
 
wingkchanAuthor Commented:
Got it to work again.  I think the reason that the hosts file was not put to use might have because it was corrupted somehow.  I renamed the original hosts file, and then create another one, add the entries in, and now, I can connect to other machines by names.
0
 
KaddictCommented:
That "corruption" may have been bad permissions too.

Hope I helped at least a little =)

-kaddict
0
 
wingkchanAuthor Commented:
Thanks Kaddict... sometimes to find the answer requires lots of trials and error...
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now