Archive for the 'Misc Software' Category

The importance of DNS -part 2

Tuesday, January 29th, 2008

So now you understand what DNS is. How do you use it?

The first thing you need to do for each domain is to put in the correct name server at the registrar (ex. godaddy).

If you are using your own DNS servers then the name server will probably be ns1.mydomain.com and ns2.mydomain.com where mydomain is the domain you registered. If you are going to be running your own DNS servers then I recommend at this point to contact your registrar and let them know you will be running you’re own DNS servers. They will probably ask you what your static ip will be. This will be given to you by your colocation facility or isp that you are using. You CANNOT run your own dns servers on a cablemodem/dialup or anything that your ip changes on, EVER. You need a staic ip that changes very rarely (once every few years if possible)

If you use a free DNS service, then you would input the servers used by that services (ex. ns1.zoneedit.com ns5.zoneedit.com).

Now that you have setup the name servers fo your domain, it’s time to learn some basic DNS type records. We’re going use mydomain.com as an example.

mydomain.com is the official hostname. Not www.mydomain.com, and not anything else. The prefix www. or ftp. or mail. or blog. are all just subdomains.

Below are a few of the most common dns record types:

  • A
  • CNAMES
  • MX

A records are the most common and typically point to the ip address of the location.

example 1: You want mydomain.com to point to 192.168.1.2

example 2: You want www.mydomain.com to point to 192.168.1.2

You can assign multiple A records to the same ip address or point different records to different ips. For example dev.mydomain.com might point to a different ip on a different machine since it will be for development work

CNAME records can be treated like A records except they can also forward to another address. So dev.mydomain.com might actually forward to www.google.com

If you will not be forwarding to anything else, then I suggest using A name records since it will save on DNS queries.

MX records. These records tell mail servers where to deliver mail to.

example: You want to run a mail server on ip 192.168.1.2

  1. Setup the mail address A record (mail.mydomain.com) to point to 192.168.1.2
  2. Setup the MX record with to point to mail.mydomain.com

The idea behind MX records is that you could have several mail servers running on different ips that could receive mail for your domain. Each MX record can have a weight which will determine in order which mail server to try if one in unreachable.

Another good example is that you might want to use someone else’s mail server if you do not wish to run your own. An example is the google email system.

The importance of DNS -part 1

Tuesday, January 29th, 2008

Why is DNS important. Let me put it in layman’s terms. DNS is important since it’s kind of like a phone book for the internet. Bear with me as this is going to be watered down considerably for ease of consumption.

Every domain you go to whether it be www.yahoo.com, digg.com or even tech.doodleboy.org typically have a machine address in an ipv4 notation such as 123.456.789.123 . Now, remembering this address for every site you go to would be rather hard. Hence DNS.

When you request a domain from any program such as a web browser or ftp client or send an email, that request goes to a DNS server (your isp’s dns server first) to find out what the machine address is for that domain. If that first DNS server doesn’t know the machine address (called an ip address) then it will ask the DNS server above it and so on until a DNS server that knows the ip address of the domain you want can reply back with the appropriate ip address information back down the chain.

Often the initial DNS server that your computer asked will then cache the information for future use. This is why typically it takes at least an hour or two to make changes to your dns setting for a domain. The information must propagate to many server who have internal caches that don’t reload often (every 24 hours).

Now, why is this important to you? DNS is needed so someone can find your domain. If you are hosting your own site (home pc / own servers) then you have a few choices on how to handle dns. This article is geared toward those that do their own hosting.

Choices:

  • Run your own using DNS software. Some common DNS servers.
  • Use someone else’s DNS services. A sampling below:

When you initially buy a domain name from a registrar like godaddy or network solutions, you are asked during that process what the name servers will be. These nameserver (typically ns1.something.com and ns1.something.com) point to the domain name server that will tell the world where to find your domain. In my next article I will illustrate how this works.