3

When I use cmd to ping a domain like:

> ping apple.com
Pinging apple.com [17.142.160.59] with 32 bytes of data:
Request timed out.

I did't get the response, but I get the IP of it.

Why can I get the IP of the domain with no responding?

Is somewhere storing a table with a lot of domain and IP?

Or the server got my request but block it by firewall?

2
  • 2
    Your locally configured DNS server will lookup the domain name as part of your ping command. Since ping doesn't know anything about domains it will need help to look it up, using the DNS.
    – user56700
    Commented Jul 17, 2019 at 6:34
  • 1
    Remember that ping is an application, just like any other application, e.g. your web browser, so it can use names and DNS to translate those names into addresses. The network stack (OSI layers 1 to 4, what is on-topic here) does not use names, only addresses.
    – Ron Maupin
    Commented Jul 17, 2019 at 13:56

1 Answer 1

10

Why can I get the IP of the domain with no responding?

Because you don't actually get the IP address from the domain itself. You always get it from a separate database – the DNS (Domain Name System).

(You actually can't send anything to a domain name directly – you have to get the IP address first, and only then send the ping packets to that IP address.)

It's similar to telephone numbers: you would use a phonebook to find someone's phone number (or google for the number) before you could call someone.

Is somewhere storing a table with a lot of domain and IP?

Yes, it's called DNS. (Note that it's not a single table – each domain has its own small "table" with its own subdomains and addresses only, hosted on its own DNS servers.)

1
  • 1
    Just for reference: the 'reverse' resolution from IP address to host name uses the PTR record in DNS.
    – Zac67
    Commented Jul 17, 2019 at 9:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .