Posts Tagged ‘DNS’

How DNS Work

Sunday, February 11th, 2007 by hejian

What are Name servers doing

Naver servers do two things all day long:

  • The accept requests from programs to convert domain names into IP addresses.
  • They accept requests from other name servers to convert domain names into IP addresses.

When a request comes in, the name server can do one of four things with it:

  • It can answer the request with an IP address because it already knows the IP address for the domain.
  • It can contact another name server and try to find the IP address for the name requested. It may have to do this multiple times.
  • It can say, “I don’t know the IP address for the domain you requested, but here’s the IP address for a name server that knows more than I do.
  • I can return an error message because the requested domain name is invalid or does not exist.

Authoritative DNS Servers

Authoritative servers provide the definitive information for your DNS domain, such as the names of servers and Web sites in it. They are the last word in information related to your domain.

How DNS Servers Find Out Your Site Information

There are 13 root authoritative DNS servers (super duper authorities) that all DNS servers query first. These root servers know all the authoritative DNS servers for all the main domains - .com, .net, and the rest. This layer of servers keep track of all the DNS servers that Web site systems administrators have assigned for their sub domains.

For example, when you register your domain my-site.com, you are actually inserting a record on the .com DNS servers that point to the authoritative DNS servers you assigned for your domain. (More on how to register your site later.).

Create a New Domain Name

When someone wants to create a new domain, he or she has to do two things:

  • Find a name server for the domain name to live on.
  • Register the domain name.

Get a name server for a domain

There are two ways to get a name server for a domain:

  • You can create and administrater it yourself.
  • You can pay an ISP or hosting company to handle it for you.

Most larget companies have their own domain name servers. Most smaller companies pay someone.

Own or register a DNS

You do not need to own or register your own DNS (domain name servers) in order to register a domain name or to sign up for email or Web hosting services.

In the same way that a domain name must be registered with a central registry to be recognized on the Internet, DNS (domain name servers) must also be registered with a central registry.

You must actually have a DNS in operation at a dedicated and unique IP Address (that is not yet registered as a DNS server) in order for the DNS server registration to be completed.

When To Use A DNS Caching Name Server

Most servers don’t ask authoritative servers for DNS directly, they usually ask a caching DNS server to do it on their behalf. These servers, through a process called recursion, sequentially query the authoritative servers at the root, main domain and sub domain levels to get eventually get the specific information requested. The most frequently requested information is then stored (or cached) to reduce the lookup overhead of subsequent queries.

If you want to advertise your Web site www.my-site.com to the rest of the world, then a regular DNS server is what you require. Setting up a caching DNS server is fairly straightforward and works whether or not your ISP provides you with a static or dynamic Internet IP address.

After you set up your caching DNS server, you must configure each of your home network PCs to use it as their DNS server. If your home PCs get their IP addresses using DHCP, then you have to configure your DHCP server to make it aware of the IP address of your new DNS server, so that the DHCP server can advertise the DNS server to its PC clients. Off-the-shelf router/firewall appliances used in most home networks usually can act as both the caching DNS and DHCP server, rendering a separate DNS server is unnecessary.

When To Use A Static DNS Server

If your ISP provides you with a fixed or static IP address, and you want to host your own Web site, then a regular authoritative DNS server would be the way to go. A caching DNS name server is used as a reference only, regular name servers are used as the authoritative source of information for your Web site’s domain.

Note: Regular name servers are also caching name servers by default.

DNS record types

Saturday, February 10th, 2007 by hejian

This is a list of some important DNS record tpes.

NS
NS, or name server, specifies the name servers for a given zone.

A
A, or address, records describe the IP that a given DNS node has.

CNAME
CNAME, or canonical name record, maps an alias or nickname to the real or Canonical name which may lie outside the current zone.

MX
MX, or mail exchange, records describe the machines to contact in order to send mail to a given DNS node.

PTR
A PTR record is what lets someone do a “reverse” DNS lookup. you can use “dig -x” to do a reverse lookup:

dig -x xxx.xxx.xxx.xxx

Not every IP address has a corresponding PTR record. you may not be able to send email to some sites if you don’t have a valid PTR record, or if your pointer is “generic”.

TXT
TXT, or text, records are arbitrary text strings which can be attached to given DNS nodes. Certain protocols, such as SPF, use this field to store protocol-specific data.

SOA
SOA, or Start of Authority, specifies that this server is authoritative for this zone. An authoritative server is the best source for data within a zone. The SOA record contains general information about the zone and reload rules for secondary servers. There can be only one SOA record per zone.

DNS tools

Saturday, February 10th, 2007 by hejian

Linux includes a number of standard tools that allow you to work with DNS. Here are the tools you will use:

dig
Forward lookup with dig: dig hostname
Query on specific name server: dig hostname @server
Reverse lookup with dig: dig -x IP

host
Forward lookup with host: host hostname
Reverse lookup with host: host IP

nslookup
Forward lookup using nslookup: nslookup hostname
Lookup on specific name server: nslookup hostname server
Reverse lookup using nslookup: nslookup IP

whois
A command-line utility from the whois package, whois queries the database at whois.networksolutions.com.

Usage:
whois xxx.xxx.xxx.xxx
whois domainname

3322.org dynamic DNS setup

Friday, February 9th, 2007 by hejian

Setup on CentOS 4
# cat /etc/ppp/ip-up.local
lynx -mime_header -auth=username:password “http://www.3322.org/dyndns/update?system=dyndns&hostname=name.3322.org”
# chmod +x /etc/ppp/ip-up.local

Setup on Debian Sarge
#cat /etc/ppp/ip-up.d/02-dyndns
lynx -mime_header -auth=username:password “http://www.3322.org/dyndns/update?system=dyndns&hostname=name.3322.org”
#chmod +x /etc/ppp/ip-up.d/02-dyndns

Wordpress template made by HeJian