Ping is fast but dns is slow

DNS response is slow avg 12-15 ms


$ dig @1.1.1.1 one.one.one.one | grep "Query time:"
;; Query time: 12 msec

Ping is fast for 1.1.1.1 but 10ms for 1.0.0.1

$ ping 1.1.1.1 -c 10
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
▁▁▁▁▁▁▁▁▁▁
 0/ 10 ( 0%) lost;    0/   1/   1ms; last:    1ms
 0/ 10 ( 0%) lost;    0/   1/   1/   0ms (last 10)
--- 1.1.1.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9013ms
rtt min/avg/max/mdev = 0.970/1.230/1.345/0.105 ms
```
```
traceroute 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 60 byte packets
 1  router.asus.com (192.168.1.2)  0.130 ms  0.089 ms  0.069 ms
 2  one.one.one.one (1.1.1.1)  1.374 ms  1.361 ms  1.324 ms
```

I think that the DNS resolution time should match the ping latency. OR is this wrong?

Location: India (Kanpur)

12ms is slow? :joy:

DNS resolution and ping measure two completely different things.

1 Like

12ms is slow? :joy:
No. but only if you compare ping vs. DNS latency here (1 ms vs. 12 ms).

DNS resolution and ping measure two completely different things.
Yes, I understand but thought if the ping is so fast (1 ms), DNS latency should be in this range.
BTW 12 ms avg. was just for one.one.one.one, most of the hostname gives around avg 50-100 ms.
So if DNS latency is more than 50-100 ms, Can I debug something else to fix this?

There is nothing to fix. None of those results is slow.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.