-   Linux - Networking (
-   -   Theory - Resolving ip address (

LeHibou2 03-29-2013 02:18 AM

Theory - Resolving ip address
Hi !

I would like to know how exactly my browser knows how to resolve an ip address when I type it directly in my browser.

I know about dns with name resolution, but what if I type ?

I cannot understand what is the followed path to the final server in this precise case.
Doubt that it reaches zny dns server before being redirected, since it is not a name resolution but directly an ip resolution..

Any help ?


manu-tm 03-29-2013 03:53 AM

Only domain names are resolved to IP addresses, not IP addresses themselves. But I'm afraid your question is not specific enough to be answered concisely here (IMO). And there are loads of online doc about this subject:

Then, with more precise questions, you will probably get better answers.

pan64 03-29-2013 03:56 AM

name is resolved, it will be translated to an ip. ip is not resolved, ip is used to find another host.

LeHibou2 03-29-2013 05:08 AM

Hi !

When i type -> it goes on the root dns, then back to my registrar/hosting provider which has the ip and gives the right to go on my website which has a dedicated ip.

But, how can root-dns be aware of where to look at to find the ip ?? There are so many hosting providers !

That is my question. I think we are at the root of the internet with this one.

To clarify : it is to understand, I know everybody use dns, but I need to understand.

eSelix 03-29-2013 05:55 AM

When you type IP address in browser window it will connect directly to server with this address, no DNS is used.

manu-tm 03-29-2013 06:04 AM


Originally Posted by LeHibou2 (Post 4920985)
But, how can root-dns be aware of where to look at to find the ip ?? There are so many hosting providers !

By querying databases they manage / maintain.

pan64 03-29-2013 06:09 AM

DNS does not care about that. the routing table will tell the host where to look for that given ip.
see here:

LeHibou2 03-29-2013 07:21 AM


But I just cannot imagine that the root servers do requests/memcache request for all the ip's.

What kind of datacenters would it be ?

Bunch of ram ??

Please excuse me for being a numb, but I just open the eyes.

According to some sources, we talk about 13 clusters of 345 machines overall to handle the whole internet traffic.

The ram needed would not fit in 345 machines. Should we understand that each machine is a memcache shard for each cluster ? and that every cluster has the same datas ?
Then we would have problems with wan, so it is not possible.

Meaning that the informations are replicated 12 other times since every request might not hit the same root server ?


pan64 03-29-2013 07:31 AM

why should they handle the whole internet traffic?
see here:

LeHibou2 03-29-2013 09:52 AM


I read in an article this point. It was wrong.


DNS servers that perform the first task are normally managed by your Internet service provider (ISP). As mentioned earlier, the ISP's DNS server is part of the network configuration you get from DHCP as soon as you go online. These servers reside in your ISP's data centers, and they handle requests as follows:

If it has the domain name and IP address in its database, it resolves the name itself.
If it doesn't have the domain name and IP address in its database, it contacts another DNS server on the Internet. It may have to do this multiple times.
If it has to contact another DNS server, it caches the lookup results for a limited time so it can quickly resolve subsequent requests to the same domain name.
If it has no luck finding the domain name after a reasonable search, it returns an error indicating that the name is invalid or doesn't exist.
So :
A is asking for my website.
Either he types, then his request will go to his isp then, the isp will ask another dns server.
Or he types my ip address (not likely) and skip the dns step, and, if my ip is dedicated, lands on my website.

Like I said, there are multiple (thousands ? millions?) dns servers. Assuming the requests are really fast between servers, it would still take really long time to get the answer the first time.

Should be -much- more than a minute ?!

In case I run my dns server (SOA) on a new website, the very first time someone looks for my website, his isp will contact many dns hosters/registrars and ask for my dns. My registrar/dns host advertises me, telling the world that my dns is no more hosted by them, but at my nameserver that I put in ns1 ns2. Right ?

Many thanks !

pan64 03-29-2013 11:58 AM

1. you can see, it takes less than a second (in general, but sometimes more)
2. not really, your name is registered by your ISP, his DNS will serve your IP. You do not need to have DNS. Also your own DNS will not recognised at all (only if it was registered as "official").

baldy3105 03-29-2013 02:03 PM

The browser itself recognises valid IP addresses. When it see's one in the URL it does not bother to do a DNS lookup, or in fact what would technicaly be a reverse DNS lookup. The browser goes direct to the IP.

i.e. my router is HTTP:// takes me to the admin page.

HTTP://192.168,1.1 gives me a DNS error as it is not a valid IP therefore the browser has attempted to resolve it.

rknichols 03-29-2013 06:23 PM

DNS just translates names to numeric IP addresses. Once you've got that number, DNS, just like a phone book, is out of the picture. When you give your browser a valid dotted quad IP address or anything else that can represent a 32-bit (for IPv4) number, it just puts that number into the destination address field of the IP packet and doesn't use DNS at all.

The following are all equivalent:

jefro 03-29-2013 09:00 PM

The actual order is to look at browsers settings, might be some unique setting like pac file, then hosts file lookup, then it goes out to dns.

manu-tm 03-29-2013 09:49 PM

It's implemented at browser level by calling getaddrinfo() which takes care of domain names / IP addresses, before opening a socket to 'talk' to the server.

All times are GMT -5. The time now is 01:30 AM.