If I enter an IP for a website rather than the string form, does my local DNS server understand this and will I bypass the DNS process?

If you use an IP address, the OS will know that it is an IP address immediately, and will not do a forward lookup.

When you do a HTTP request, the first step is to obtain the IP address of the destination, so that the browser can communicate with the server. For communication with the server, everything happens over IP, from IP address to IP address, and so the name of the server is not needed for this communication. However, it is passed in the HTTP headers as a Host: header to let the web server know which website you are after, if it is hosting multiple sites.

In the case of accessing by IP address, this does not happen, and the default site is presented.

Your hosts file is a static file, it does not change by any action you take, except if you directly edit it (or have scripts or applications that modify it).


As others have written, by using an IP address you are indeed skipping the DNS which allows accessing for example development sites without a host name.

Adding an IP - mock host name into /etc/hosts is extremely common again for development sites. Unlike using the IP address directly this will a) still skip DNS b) make the browser add the Host request header to the HTTP request allowing virtual hosts on a local server for example.

Tags:

Dns