nginxdnslocalhost

Why DNS lookup take a lot of time in local?


In order to have a quite "similar" approach in local and production, I set up an NGINX that proxy the request to localhost:port. In production it redirects from subdomain.example.com to localhost:port. In local it redirects from subdomain.example.local to localhost:port and I changed my host according to :

127.0.0.1 sub1.example.local
127.0.0.1 sub2.example.local
.
.
.

When I'm testing my builds Front-Ends, DNS lookup took a lot of time (10+ seconds) and I wonder why.

chrome network screen

Thoughts ?


Solution

  • Problem solved and was related to chrome optimization module (~DNS prefetching) :

    If you face this problem, go to :