Hacker News new | ask | show | jobs
by shaklee3 3005 days ago
It might be your isp caching the DNS in a local data center after you first request it
1 comments

There is no DNS involved when you're connecting directly to an IP address
Unless you tell it not to, ping will try a reverse lookup on the IP you are pinging in order to display that to you in the output. It's a good idea to keep that in mind when you ping something, especially if you notice the first ping is abnormally slow.
That reverse lookup time is not counted in the first ping.
Perhaps that depends on operating system. In the 30 years I have been using ping on Linux, the reverse lookup time is absolutely included in the first ping time.
If true, that's a bug.

Edit: Assuming this is the right file: https://github.com/iputils/iputils/blob/master/ping.c, I don't see the reverse lookup code anywhere. But then I'm not the most proficient in reading linux code.