% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math} % this also loads fontspec
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
  % xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
  pdftitle={dns-101},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}

\title{dns-101}
\author{}
\date{}

\begin{document}
\maketitle

\hypertarget{dns-101}{%
\section{dns-101}\label{dns-101}}

\hypertarget{dns-101-1}{%
\section{DNS 101}\label{dns-101-1}}

Domain Name System (DNS) makes the Internet as we know it, work.

DNS is responsible for converting human readable Domain Names like
\emph{www.newcars.com} into computer readable IP addresses.

You can think of DNS as a distributed phone-book-directory which allows
users to look up server locations by name instead of number.

When a user enters a Domain Name into a browser, their computers OS
hands off the look up request to its configured nameserver resolvers.

\hypertarget{common-records-served-by-dns}{%
\subsection{Common records served by
DNS}\label{common-records-served-by-dns}}

A record An A record takes a hostname like www or quote and relates it
to an IP address:

.. code-block:: text

www.newcars.com. 86400 IN A 74.119.98.216

CNAME record A CNAME record or alias is a name that refers to another
name:

.. code-block:: text

stage.newcars.com. 86400 IN CNAME www.newcars.com.

PTR record A PTR record or reverse record takes an IP address and
returns a name

\hypertarget{using-dig-to-interact-with-dns}{%
\subsection{Using dig to interact with
DNS}\label{using-dig-to-interact-with-dns}}

dig domain information groper is a network administration command-line
tool for querying Domain Name System (DNS) name servers.

Use dig to lookup the IP address of \emph{www} record from
\emph{newcars.com} domain

.. code-block:: text

dig www.newcars.com +short 74.119.98.216

Use dig to lookup the IP address of \emph{stage} record from
\emph{newcars.com} domain

.. code-block:: text

dig stage.newcars.com +short www.newcars.com. 74.119.98.216

As you can see, \emph{stage.newcars.com} is an alias to
\emph{www.newcars.com}. They are both pointing at the same IP address,
and end up on the same server.

Now pretend we were given an IP address and we wanted to determine what
name was related. The dash -x flag tells dig that we want to reverse
lookup, IP to name.

.. code-block:: text

dig -x 74.119.98.216 +short www.newcars.com.

Note about +short The +short flag turns down the outputs verbosity.

\hypertarget{common-questions}{%
\subsection{Common questions}\label{common-questions}}

Why is DNS distributed? DNS is distributed to prevent outages. No one
failure of a domain should take down the whole Internet. Authorative DNS
servers maintain records for their hosts.

\end{document}
