Codepath

Domain Name System

The Domain Name System (DNS) is a set of servers which acts as an Internet phone book. They contain a directory of domain names and can translate a domain name into an IP addresses. People prefer to use easy-to-remember domain names, while computers rely exclusively on IP addresses for communication.

When a domain name is registered, DNS info is provided to the registrar to specify a DNS server which will be the domain's authority on translating domains (and subdomains) into IP addresses.

When a user types "great-site.com" into their browser, their browser sends a request to the DNS server with the domain name. The DNS server looks up the domain, and returns the IP address to the the browser. Then the browser sends an HTTP request to the server at that IP address.


DNS Tools

There are several useful tools for working with domains and DNS. These tools are handy for system administrators but are also used by attackers for Footprinting.

whois

whois is a tool for looking up any domain to find information about the registered domain owner. It is essentially a way to browse the directory of domain owners. This can be done online or from the command line.

The command whois ebay.com will return any domain matching "ebay.com" in any part. Using quotes and an equal sign will reutrn only exact matches: whois "=ebay.com".

nslookup and dig

nslookup and dig are both command-line tools for querying DNS servers. The difference between them is in the format and details of the information they return and which DNS settings they use (dig uses the computer's DNS settings, nslookup uses its own).

  • By domain name: nslookup ebay.com
  • By IP address: nslookup 66.211.160.86

  • By domain name: dig ebay.com

  • By IP address: dig 66.211.160.86

Fork me on GitHub