DNS Registar ... and putting it to work ...

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Ok, so I'm testing this dns registar thing, and something it not quite fitting my mind.

I have an online site (hurray), let's say, for instance:

http://b4u.freehosting.com

So everything works fine, but I don't like the address ...

I go to a free registar (let's imagine http://www.regonline.com), and I create the DNS:

http://www.b4u.com

After that, they give me some info:

Nameserver 1: ns1.regonline.com (209.126.149.70)
Nameserver 2: ns2.regonline.com (65.125.217.45)

They say that I have to give this info to my web hosting provider ...

Can anyone please explain me why do I have to do that?

I mean, when I go to URL http://www.b4u.com shouldn't the browser first ask the IP of that address, and shouldn't it directly receive it? There is just one definition of that address, in the place where I've registered it (ok, it will spread around the globe, but it's a "copy" of the original one).

Something like a pointer ... I can point to somewhere, and don't need to go there saying "Hey, that guy is pointing at you!".

Something doesn't quite fit ...
 

jfall

Diamond Member
Oct 31, 2000
5,975
2
0
When a request is made to your domain name, the NAME SERVERS are contacted. The name servers hold the DNS Zone record for your domain which specifies a partiular IP Address, whatever IP Address the `A` record for your domain is pointing to is what your domain will resolve to
 

jfall

Diamond Member
Oct 31, 2000
5,975
2
0
The name server does the rest. As I mentioned, the name server holds a DNS zone for your domain, the DNS zone itself is what specifies the IP address(es) that your domain will resolve to. As long as the DNS Zone record points your domain to the proper IP address, pointing your domain to the name servers will do the job.
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
So, if I go to URL http://www.b4u.com :

- The browser contacts .com dns, dns gives the IP of the b4u.com dns;

- Browser goes down the tree level to b4u.com dns, which will be the ns1.regonline.com or ns2.regonline.com;

- the regonline dns will return the IP address of the machine http://b4u.freehosting.com


Am I correct? How does the dns knows the IP of the final http://b4u.freehosting.com is behond me ... the more I read, the more I get confused ... :(


Thank you for help
 

jfall

Diamond Member
Oct 31, 2000
5,975
2
0
Here is an example of a simple DNS zone file. This would lie on the name servers:

$TTL 86400
$ORIGIN com.
domain IN SOA ns.nameserver.com. hostmaster.nameserver.com. (
200410614 86000 7200 3600000 600 )
IN NS ns.nameservercom.
IN NS ns2.nameserver.com.

IN A 1.1.1.1
IN MX 10 mail.domain.com.
$ORIGIN domain.com.
mail IN A 1.1.1.1
ftp IN A 1.1.1.1
www IN A 1.1.1.1

When requests are made to your domain, the name servers listed in the whois record are contacted, when this happens the DNS zone loaded on the name server provides the routing for your domain requests. By looking at the above, you can see that mail.yourdomain.com, www.yourdomain.com, yourdomain.com and ftp.yourdomain.com will all point the the IP address 1.1.1.1 for example. The IP address 1.1.1.1 would be bound to a webserver running Apache for example which will serve the page/service to whoever is contacting it.

A sub-domain such as b4u.yourdomain.com could easily be setup to point to any ip address simply by adding a line like:

b4u IN A 1.1.1.1

The sub-domain could also have it's own DNS zone file on the name server, but it's not neccessary.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Read up on how DNS works. Basic rundown, and may be a bit off in specifics:

Your dns client contacts your ISP's dns server. Your ISP doesn't have the answer, so it contacts the .com root server. It gives your ISP's DNS server the IP listed in the registrar's listing. That DNS server knows where your machine is.