Page 2 of 2

Re: How does DNS and sub-domain work?

Posted: Tue Mar 03, 2009 4:21 pm
by VladSun
josh wrote:... In your registrar there should be an option to "register nameservers" which actually adds your IP as the nameserver for your namespace, then you set up bind. Just like mail relaying tho a default bind install can be used by anyone as their DNS, so you'd probably want to harden the config so it only answers for domains you own
While most of this is true there are some things to be cleared:
1) these nameservers are called "authoritative DNS servers" for your domain zone;
2) all of these servers will appear in the answer part when 'dig domain.tld NS' is queried;
3) your registrar must require that you have at least 2 different authoritative nameservers with IP addresses from 2 different IP subnets;
4) these nameservers are queried in a round robin fashion by clients;
5) because of 4) these server have to be synchronized and to respond with the same answer (or answer set when round robin fashion is used for multiple IPs per domain name) to a single query;
6) because of 5) usually master-slave DNS servers are used. Whether the response to a DNS query is received from the master or any of its slave servers doesn't matter.

Re: How does DNS and sub-domain work?

Posted: Tue Mar 03, 2009 4:23 pm
by josh
VladSun wrote: 3) your registrar must require that you have at least 2 different authoritative nameservers with IP addresses from 2 different IP subnets
Nope. Try pinging ns1.ne8.net and ns2.ne8.net ;-) Again has nothing to do with subdomains

Re: How does DNS and sub-domain work?

Posted: Tue Mar 03, 2009 4:35 pm
by VladSun
josh wrote:
VladSun wrote: 3) your registrar must require that you have at least 2 different authoritative nameservers with IP addresses from 2 different IP subnets
Nope. Try pinging ns1.ne8.net and ns2.ne8.net ;-)
WARNING: All of your nameservers (listed at the parent nameservers) are in the same Class C (technically, /24) address space, which means that they are probably at the same physical location. Your nameservers should be at geographically dispersed locations. You should not have all of your nameservers at the same location.
That's why I said "must require", right?
And ... viewtopic.php?f=30&t=87067
josh wrote:Again has nothing to do with subdomains
Reread the OP...

Re: How does DNS and sub-domain work?

Posted: Tue Mar 03, 2009 5:06 pm
by josh
VladSun wrote:Reread the OP...
I'm straight, thanks though.

Re: How does DNS and sub-domain work?

Posted: Wed Mar 04, 2009 1:41 am
by VladSun
Why and when we should (should not) use wildcards :
http://www.iab.org/documents/docs/2003- ... cards.html

Re: How does DNS and sub-domain work?

Posted: Thu Mar 05, 2009 12:38 pm
by Jenk
josh wrote:There is no way Apache Virtual hosting (the name-based one, of course) feature can be used without a properly set up DNS for the "virtual hosted" subdomains.
If I have the domain name example.com registered as 192.168.10.1, and on that machine is Apache running with NamedVirtualhost directives for http://www.example.com and somethingelse.example.com, and I type http://www.example.com in my web browser, I will get the page I am looking for.

Re: How does DNS and sub-domain work?

Posted: Thu Mar 05, 2009 2:11 pm
by VladSun
Well, the "no way" thing is not so true :)
If one edits his/her hosts file it will work.
If one constructs his/her own GET request, sets a proper HOST header and access the Apache server by IP it will work again :)
Otherwise a properly setup DNS must be used.
Jenk wrote:If I have the domain name example.com registered as 192.168.10.1, and on that machine is Apache running with NamedVirtualhost directives for http://www.example.com and somethingelse.example.com, and I type http://www.example.com in my web browser, I will get the page I am looking for.
I don't think so:

Code: Select all

DNS:
example.com. A 192.168.10.1
 
browser: 
http://www.example.com -> won't work (IP can not be resolved)
http://somethingelse.example.com -> won't work (IP can not be resolved)

Code: Select all

DNS:
example.com. A 192.168.10.1
www CNAME example.com.
 
browser: 
http://www.example.com -> OK
http://somethingelse.example.com -> won't work (IP can not be resolved)

Code: Select all

DNS:
example.com. A 192.168.10.1
www CNAME example.com.
somethingelse CNAME example.com.
 
browser: 
http://www.example.com -> OK
http://somethingelse.example.com -> OK

Code: Select all

DNS:
example.com. A 192.168.10.1
*.example.com. CNAME example.com.
 
browser: 
http://www.example.com -> OK
http://somethingelse.example.com -> OK
That's what will happen, IMHO. I think I've misunderstood what you meant, so please elaborate.

Re: How does DNS and sub-domain work?

Posted: Thu Mar 05, 2009 3:55 pm
by josh
Generally when you set up DNS your hosts creates the 2 entries for you, that's why it works with and without www. Jenk. @ vlad Next time I launch a site I'll tell my client we don't need DNS since his users can just type the IP :D

Re: How does DNS and sub-domain work?

Posted: Thu Mar 05, 2009 3:59 pm
by VladSun
josh wrote:@ vlad Next time I launch a site I'll tell my client we don't need DNS since his users can just type the IP :D
You'd better insist that they should use telnet and HTTP1.1 ;)

Re: How does DNS and sub-domain work?

Posted: Sat Mar 07, 2009 5:06 am
by VladSun
I just want to post my PM answer to PCSpectra:
PCSpectra wrote: ... We have our ISP provide our DNS ...
... we do not want to call up the ISP and request the add another CNAME for yet anotehr sub-domain...
VladSun wrote:The best way to manage your domain is to setup your own DNS server which will be the master one for the DNS servers at your ISP (only for your domain zone). This master DNS server will not answer any client DNS queries (stealth DNS). Instead, on its zone files change it will notify and transfer the zone files to the slave servers, which will be listed as the authoritative servers for your domain zone and will answer DNS queries for it - this is a common scenario.

Re: How does DNS and sub-domain work?

Posted: Sat Mar 07, 2009 5:12 am
by VladSun
A nice how-to could be found at http://www.howtoforge.com/debian_bind9_ ... ave_system
It also shows how to use DNSSEC to transfer the zone files :)