31 March 2024

Whats faster 0.0.0.0 or 127.0.0.1?

When I was experimenting with hosts and Pi-Hole, I read that "0.0.0.0" address in the hosts works faster then "127.0.0.1". And now I decided to check and prove it.

About tests

  • To automate tests I prepared code on Python "DNS_Loopback_Speed".
  • To get more accurate results I performed 10000 tests for each address and took the average.
  • I have two devices running Windows 10 and Ubuntu 22.04, so I also compare speed of resolving between Windows and Linux.
  • I've seen option of using 127.0.0.0 in hosts, therefore I add it too.
  • Just to compare delays between local resolution (hosts) and external DNS servers I add 2 tests (my local Pi-Hole DNS and Google DNS). My devices connected to network via Wi-Fi, so results may not be reliable.

Brief information regarding these IP addresses: