Wednesday 21 May 2014

DNS Technology Introduction

DNS

DNS (Domain Name Service) is one of the most important Internet infrastructures. It provides a human readable name for the Internet users while translate it to IP address or other machine understandable marks.

In DNS world, we usually use the item domain name or hostname, such as www.google.com or mail.gmail.com. the standard name is FQDN: Full Qualified Domain Name and it should be ended with a '.' eg www.google.com.

In most case, DNS provides the translation between FQDN and IP but that is not all it does.


NSSWITCH

hosts: files dns
file: /etc/hosts
dns: DNS

in OS, it uses libnss_file.so or libnss_dns.so as it's C library.


Stub Resolver

stub resolver: is the resolver client program on the host.it will handle the DNS request for the application but it can only understand a full answer to the request. it can't deal with a referral.
if it doesn't find an answer to the query in its cache, it will ask the recursive resolver that is configured.
it will accept the first valid answer that comes through, ignoring any answers that might come later.


Domain type:

organization domains:.com, .org, .net, .cc
country domains: .cn, .tw, .hk, .iq, .ir, .jp
reversed domains: IP-->FQDN

Query type: 

Recursive Query: the DNS client requires that the DNS server respond to the client with either the requested resource record or an error message stating that the record or domain name does not exist. The DNS server cannot just refer the DNS client to a different DNS server.

Iterative Query: is one in which a DNS client allows the DNS server to return the best answer it can give based on its cache or zone data. If the queried DNS server does not have an exact match for the queried name, the best possible information it can return is a referral (that is, a pointer to a DNS server authoritative for a lower level of the domain namespace). The DNS client can then query the DNS server for which it obtained a referral. It continues this process until it locates a DNS server that is authoritative for the queried name, or until an error or time-out condition is met.
DNS database is a global distributed database
    The parent know where it's directed attached children
    The Child don't know where is his parent node, usually it knows the ROOT.


DNS Server functions:


accept the local requests for 
local clients query the non-authority DNS query(recursive)
outside clients query the authority DNS query(iterative)
whether positive or nagative, DNS should give the answer with a TTL
for the outside clients query the non-authority DNS query, usually it should be denied.

DNS server types:

master DNS server: the SOA of the domain and maintain the database.
slave DNS server: the SOA of the domain and but synchronize the database from master
cached DNS server: only cache the result. Non-SOA
forwarding server: only forward the query to some other DNS server.

No comments:

Post a Comment