ping website

This is a discussion on ping website within the A Brief History of Cprogramming.com forums, part of the Community Boards category; ping www.yahoo.com ping: unknown host www.yahoo.com if i ping a website and the web server is down, i will get ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    23

    ping website

    ping www.yahoo.com
    ping: unknown host www.yahoo.com
    if i ping a website and the web server is down, i will get a response like the above. however, it took like 16 seconds to get the message, anyone know why?

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,069
    If I'm correct, "ping" sents a requests via UDP and simply counts the time until it gets an Ack message. After 16 seconds, I suppose it just gives up.
    Sent from my iPadŽ

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    If ping receives server name instead of ip, it should firstly resolve the name...
    So before actual ICMP packet the NBNS is sent, asking what is the IP of the server

    If no response is received during the timeout then message is printed that the host is unknown

    If the host ip is resolved sucessully but it does not respons to the ICMP request the timeout message is printed (4 times by default)
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Replies here:

    gethostbyname in ping
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How's my new Website
    By asbo60 in forum General Discussions
    Replies: 53
    Last Post: 07-10-2009, 10:10 AM
  2. ping script doesn't work?
    By userpingz in forum C Programming
    Replies: 3
    Last Post: 05-31-2009, 07:53 PM
  3. Replies: 8
    Last Post: 05-07-2009, 11:31 AM
  4. IPv6 ping in windows...problem..lots of ode:(
    By Neill KElly in forum C Programming
    Replies: 3
    Last Post: 04-27-2009, 11:50 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21