Mobile app version of vmapp.org
Login or Join
Heady270

: How to reduce DNS lookups? It takes about 20-120 milliseconds for DNS (Domain Name System) to resolve IP address for a given hostname or domain name and the browser cannot do anything until

@Heady270

Posted in: #Dns #DnsLookup #IpAddress #IpResolve #Optimization

It takes about 20-120 milliseconds for DNS (Domain Name System) to resolve IP address for a given hostname or domain name and the browser cannot do anything until the process is properly completed.

Before a browser can establish a network connection to a web server, it must resolve the DNS name of the web server to an IP address. Since DNS resolutions can be cached by the client's browser and operating system, if a valid record is still available in the client's cache, there is no latency introduced. However, if the client needs to perform a DNS lookup over the network, the latency can vary greatly depending on the proximity of a DNS name server that can provide a valid response.

So... how to / is there any way to reduce this DNS lookups through some server-side optimization or something else? Am i helpless here or it depends on size of web page / my hosting provider?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Pierce454

Usually every DNS resolver like Bind has a DNS cache. if x.x.x.x is my DNS server, when i type

dig A averyuncommonebsite.com @x .x.x.x


i get first 2 figures for the response time. Then, the second time i i request it, i get an answer in 1ms because the response is in the cache of my DNS resolver which is BIND. So you may build up your own DNS resolver to have control on the DNS response time.

10% popularity Vote Up Vote Down


 

@Eichhorn148

The DNS lookup takes place well before the client has started reading the web page, so don't worry about page size. Remember that DNS is basically the process of translating a domain name to an IP address, so myexample.com --> 123.45.678.9, and this translation has to happen before the page itself can be requested from the IP address. The page could be tiny or extremely large, and the DNS lookup will take the same time.

So if you want to reduce DNS lookup times, you should make sure there's a very reliable DNS server not far from the client. That could mean:


Hosting your DNS separately from your registrar or regular web host. There are dedicated providers of DNS hosting, like DNS Made Easy and Dyn.com. These services will operate a globally-distributed network of DNS servers, so that the lookup can be answered as close to each client machine as possible. And (the theory goes), because they're only running DNS, they actually invest in that infrastructure and care about it being reliable (as opposed to some registrars we could name).
Hosting your own DNS servers. Be sure to fully understand it first though. You'll need a couple of VPSs in order to keep the service redundant. All these servers will do is handle DNS queries, and you can set about optimising their performance to your heart's content, beginning by installing something like PowerDNS, tinydns, or BIND.


Personally, I wouldn't encourage you to host your own DNS servers unless you really know what you're doing, and have a strong reason for doing so. In almost all cases, the relatively low cost of dedicated DNS hosting with one of the providers I mentioned will make that the better choice.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme