Domain Name System (DNS)
In this article, we'll learn about the basics of DNS: the mechanics of DNS resolution, including name servers, zone files, and individual DNS records.
Name servers host a domain's DNS information in a text file called the zone file. They're are also known as Servers of Authority (SOAs).
We specify name servers on our domain registrar's website. They'll take care of publishing that information to the higher-level name servers.
The following shows names servers (NS) on Godaddy registrar for xophist.com which is actually hosted by AWS:
DNS records match domain names to IP addresses. The DNS records are then automatically bundled up into a zone file, which is what allows the Internet to look up the correct IP address for our domain.
Here are some of the samples of DNS records.
AWS Route53 for epicmath.com:
linode for pygoogle.com:
godaddy for 1lnx.com:
Here is the list of the most common records:
- Address Mapping records (A) The record A specifies IP address (IPv4) for given host. A records are used for conversion of domain names to corresponding IP addresses.
- IP Version 6 Address records (AAAA)
The record AAAA (also quad-A record) specifies IPv6 address for given host. So it works the same way as the A record and the difference is the type of IP address.
- Canonical Name records (CNAME)
The CNAME record specifies a domain name that has to be queried in order to resolve the original DNS query. Therefore CNAME records are used for creating aliases of domain names. CNAME records are truly useful when we want to alias our domain to an external domain. In other cases we can remove CNAME records and replace them with A records and even decrease performance overhead.
- Mail exchanger record (MX)
The MX resource record specifies a mail exchange server for a DNS domain name. The information is used by Simple Mail Transfer Protocol (SMTP) to route emails to proper hosts. Typically, there are more than one mail exchange server for a DNS domain and each of them have set priority.
- Name Server records (NS)
The NS record specifies an authoritative name server for given host.
- Reverse-lookup Pointer records (PTR)
As opposed to forward DNS resolution (A and AAAA DNS records), the PTR record is used to look up domain names based on an IP address.
- Start of Authority records (SOA)
The record specifies core information about a DNS zone, including the primary name server, the email of the domain administrator, the domain serial number, and several timers relating to refreshing the zone.
The A and CNAME records are the two common ways to map a host name (name hereafter) to an IP address.
From CNAME record
The A record points a name to a specific IP.
A CNAME(Canonical Name) record always point to another domain name, never directly to an IP-address.
The canonical (true) name of bar.example.com is foo.example.com, and the right-hand side is the actual CNAME. So, the first line may be read as:
bar.example.com is an alias for the canonical name (CNAME) foo.example.com. A client will request bar.example.com and the answer will be foo.example.com.
The domain name needs to get translated into IP address. DNS matches human-friendly domain names like "example.com" to computer-friendly IP addresses like 184.108.40.206. This happens in a special text file called a zone file, which lists domains and their corresponding IP addresses (and a few other things). A zone file is like a phone book that matches names with street addresses.
The following diagram shows how the DNS lookup process works:
Pic. credit : DNS Records: an Introduction
DevOps / Sys Admin Q & A
Linux - system, cmds & shell programming
- Linux Tips - links, vmstats, rsync
- Linux Tips 2 - ctrl a, curl r, tail -f, umask
- Linux - bash I
- Linux - bash II
- Linux - Uncompressing 7z file
- Linux - sed I (substitution: sed 's///', sed -i)
- Linux - sed II (file spacing, numbering, text conversion and substitution)
- Linux - sed III (selective printing of certain lines, selective definition of certain lines)
- Linux - 7 File types : Regular, Directory, Block file, Character device file, Pipe file, Symbolic link file, and Socket file
- Linux shell programming - introduction
- Linux shell programming - variables (readonly, unset)
- Linux shell programming - special shell variables
- Linux shell programming : arrays - three different ways of declaring arrays & looping with $*/$@
- Linux shell programming : operations on array
- Linux shell programming : variables & commands substitution
- Linux shell programming : metacharacters & quotes
- Linux shell programming : input/output redirection & here document
- Linux shell programming : loop control - for, while, break, and break n
- Linux shell programming : for-loop
- Linux shell programming : if/elif/else/fi
- Managing User Account - useradd, usermod, and userdel
- Linux Secure Shell (SSH) I : key generation, private key and public key
- Linux Secure Shell (SSH) II : ssh-agent & scp
- Linux Secure Shell (SSH) III : SSH Tunnel as Proxy - Dynamic Port Forwarding (SOCKS Proxy)
- Linux Secure Shell (SSH) IV : Local port forwarding (outgoing ssh tunnel)
- Linux Secure Shell (SSH) V : Reverse SSH Tunnel (remote port forwarding / incoming ssh tunnel) /)
- Linux Processes and Signals
- Linux Drivers 1
- Linux Debugging using gdb
- Embedded Systems Programming I - Introduction
- Embedded Systems Programming II - gcc ARM Toolchain and Simple Code on Ubuntu/Fedora
- LXC (Linux Container) Install and Run
- Hadoop - 1. Setting up on Ubuntu for Single-Node Cluster
- Hadoop - 2. Runing on Ubuntu for Single-Node Cluster
- ownCloud 7 install
- Ubuntu 14.04 guest on Mac OSX host using VirtualBox I
- Ubuntu 14.04 guest on Mac OSX host using VirtualBox II
- Windows 8 guest on Mac OSX host using VirtualBox I
- Ubuntu Package Management System (apt-get vs dpkg)
- How to Make a Self-Signed SSL Certificate
- DevOps / Sys Admin interview questions
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization