| 1 |
\documentclass[a4paper,11pt]{article} |
| 2 |
|
| 3 |
\usepackage[margin=2.5cm]{geometry} |
| 4 |
\usepackage{lmodern} |
| 5 |
\usepackage[T1]{fontenc} |
| 6 |
\usepackage{hyperref} |
| 7 |
\usepackage{enumitem} |
| 8 |
\usepackage{fancyvrb} |
| 9 |
\usepackage{multicol} |
| 10 |
\usepackage{dnsrecord} |
| 11 |
|
| 12 |
\hypersetup{ |
| 13 |
colorlinks=true, |
| 14 |
linkcolor=blue, |
| 15 |
urlcolor=blue, |
| 16 |
pdftitle={dnsrecord -- Typeset DNS Records in LaTeX}, |
| 17 |
pdfauthor={Vahid Shaik}, |
| 18 |
} |
| 19 |
|
| 20 |
\title{\textbf{dnsrecord} --- Typeset DNS Records in \LaTeX\\[0.5em] |
| 21 |
\large Version 1.0.0\\[0.3em] |
| 22 |
\normalsize A comprehensive package for DNS documentation} |
| 23 |
\author{Vahid Shaik\thanks{Homepage: \url{https://dnsrobot.net} |
| 24 |
--- Repository: \url{https://github.com/dnsrobot/latex-dnsrecord}}} |
| 25 |
\date{March 9, 2026} |
| 26 |
|
| 27 |
\begin{document} |
| 28 |
|
| 29 |
\maketitle |
| 30 |
|
| 31 |
\begin{abstract} |
| 32 |
The \texttt{dnsrecord} package provides a comprehensive set of \LaTeX{} macros |
| 33 |
and environments for typesetting DNS (Domain Name System) records, zone files, |
| 34 |
propagation status tables, DNSSEC chain-of-trust diagrams, email authentication |
| 35 |
summaries, health check reports, latency comparisons, and DNS provider tables. |
| 36 |
It is designed for network engineers, system administrators, security researchers, |
| 37 |
and computer science academics who need to include DNS data in papers, theses, |
| 38 |
technical reports, and operational documentation. |
| 39 |
The package supports 22 DNS record types with color-coded badges, configurable |
| 40 |
display options, and both inline and tabular output formats. |
| 41 |
\end{abstract} |
| 42 |
|
| 43 |
\tableofcontents |
| 44 |
\newpage |
| 45 |
|
| 46 |
% ================================================================ |
| 47 |
\section{Introduction} |
| 48 |
% ================================================================ |
| 49 |
|
| 50 |
The Domain Name System is one of the most critical components of internet |
| 51 |
infrastructure, translating human-readable domain names to IP addresses |
| 52 |
and providing essential services like email routing, service discovery, and |
| 53 |
security validation. Despite its importance, there has been no standard |
| 54 |
\LaTeX{} package for consistently typesetting DNS data in technical documents. |
| 55 |
|
| 56 |
Authors of networking papers, system administration guides, and security |
| 57 |
audit reports typically resort to ad-hoc \texttt{verbatim} environments, |
| 58 |
manual table formatting, or inconsistent text markup when presenting DNS |
| 59 |
records. This leads to: |
| 60 |
|
| 61 |
\begin{itemize}[nosep] |
| 62 |
\item Inconsistent visual presentation across documents and authors |
| 63 |
\item Difficulty distinguishing between record types at a glance |
| 64 |
\item No semantic markup for DNS-specific data |
| 65 |
\item Time wasted on formatting instead of content |
| 66 |
\end{itemize} |
| 67 |
|
| 68 |
The \texttt{dnsrecord} package addresses these issues by providing: |
| 69 |
|
| 70 |
\begin{itemize}[nosep] |
| 71 |
\item \textbf{22 record type commands} with color-coded badges |
| 72 |
(A, AAAA, CNAME, MX, NS, TXT, SOA, PTR, SRV, CAA, DNSKEY, DS, |
| 73 |
RRSIG, NSEC, NSEC3, TLSA, HTTPS, SVCB, SPF, DKIM, DMARC) |
| 74 |
\item \textbf{7 environments} for zone tables, propagation checks, |
| 75 |
DNSSEC chains, health reports, email auth, latency, and provider comparisons |
| 76 |
\item \textbf{Utility commands} for domains, IPs, TTLs, RCODEs, flags, and headers |
| 77 |
\item \textbf{6 package options} for customizing output appearance |
| 78 |
\end{itemize} |
| 79 |
|
| 80 |
% ================================================================ |
| 81 |
\section{Installation} |
| 82 |
% ================================================================ |
| 83 |
|
| 84 |
\subsection{Quick install} |
| 85 |
|
| 86 |
Copy \texttt{dnsrecord.sty} to the same directory as your document, |
| 87 |
or to your local \texttt{texmf} tree: |
| 88 |
|
| 89 |
\begin{Verbatim}[frame=single] |
| 90 |
cp dnsrecord.sty ~/texmf/tex/latex/dnsrecord/ |
| 91 |
texhash ~/texmf |
| 92 |
\end{Verbatim} |
| 93 |
|
| 94 |
\subsection{Dependencies} |
| 95 |
|
| 96 |
The package requires the following (all included in TeX Live and MiKTeX): |
| 97 |
|
| 98 |
\begin{multicols}{3} |
| 99 |
\begin{itemize}[nosep] |
| 100 |
\item \texttt{booktabs} |
| 101 |
\item \texttt{xcolor} |
| 102 |
\item \texttt{xparse} |
| 103 |
\item \texttt{etoolbox} |
| 104 |
\item \texttt{amsmath} |
| 105 |
\end{itemize} |
| 106 |
\end{multicols} |
| 107 |
|
| 108 |
% ================================================================ |
| 109 |
\section{Package Options} |
| 110 |
% ================================================================ |
| 111 |
|
| 112 |
\begin{Verbatim}[frame=single] |
| 113 |
\usepackage[color,monospace,ttl]{dnsrecord} % defaults |
| 114 |
\end{Verbatim} |
| 115 |
|
| 116 |
\begin{description}[style=nextline,leftmargin=3cm] |
| 117 |
\item[\texttt{color} / \texttt{nocolor}] |
| 118 |
Enable or disable color-coded record type badges. |
| 119 |
Default: \texttt{color}. Use \texttt{nocolor} for black-and-white printing. |
| 120 |
\item[\texttt{monospace} / \texttt{nomonospace}] |
| 121 |
Render DNS names, values, and IPs in monospace (\texttt{typewriter}) font. |
| 122 |
Default: \texttt{monospace}. |
| 123 |
\item[\texttt{ttl} / \texttt{nottl}] |
| 124 |
Show or hide TTL (Time To Live) values in records and tables. |
| 125 |
Default: \texttt{ttl}. |
| 126 |
\item[\texttt{class} / \texttt{noclass}] |
| 127 |
Show or hide DNS class (IN) in records and zone tables. |
| 128 |
Default: \texttt{noclass}. |
| 129 |
\item[\texttt{compact}] |
| 130 |
Use compact table layout. Default: off. |
| 131 |
\item[\texttt{boxed}] |
| 132 |
Render inline records in bordered boxes. Default: off. |
| 133 |
\end{description} |
| 134 |
|
| 135 |
% ================================================================ |
| 136 |
\section{Inline Record Commands} |
| 137 |
% ================================================================ |
| 138 |
|
| 139 |
\subsection{Generic command} |
| 140 |
|
| 141 |
The base command for any DNS record type: |
| 142 |
|
| 143 |
\begin{Verbatim}[frame=single] |
| 144 |
\dnsrecord{type}{name}{value}[ttl] |
| 145 |
\end{Verbatim} |
| 146 |
|
| 147 |
\noindent The \texttt{ttl} parameter is optional and controlled by the |
| 148 |
\texttt{ttl}/\texttt{nottl} package option. |
| 149 |
|
| 150 |
\medskip |
| 151 |
\noindent Example: |
| 152 |
\begin{Verbatim}[frame=single] |
| 153 |
\dnsrecord{A}{example.com}{93.184.216.34}[300] |
| 154 |
\end{Verbatim} |
| 155 |
\noindent Result: \dnsrecord{A}{example.com}{93.184.216.34}[300] |
| 156 |
|
| 157 |
\subsection{Standard record types} |
| 158 |
|
| 159 |
\noindent\textbf{Address records:} |
| 160 |
|
| 161 |
\medskip |
| 162 |
\noindent\dnsA{example.com}{93.184.216.34}[300] |
| 163 |
|
| 164 |
\medskip |
| 165 |
\noindent\dnsAAAA{example.com}{2606:2800:220:1::1946}[300] |
| 166 |
|
| 167 |
\bigskip |
| 168 |
\noindent\textbf{Name resolution:} |
| 169 |
|
| 170 |
\medskip |
| 171 |
\noindent\dnsCNAME{www.example.com}{example.com}[3600] |
| 172 |
|
| 173 |
\medskip |
| 174 |
\noindent\dnsNS{example.com}{ns1.example.com}[86400] |
| 175 |
|
| 176 |
\medskip |
| 177 |
\noindent\dnsPTR{34.216.184.93.in-addr.arpa}{example.com}[3600] |
| 178 |
|
| 179 |
\bigskip |
| 180 |
\noindent\textbf{Mail and services:} |
| 181 |
|
| 182 |
\medskip |
| 183 |
\noindent\dnsMX{example.com}{10}{mail.example.com}[3600] |
| 184 |
|
| 185 |
\medskip |
| 186 |
\noindent\dnsSRV{\_sip.\_tcp.example.com}{10}{sip.example.com}{5060}[3600] |
| 187 |
|
| 188 |
\bigskip |
| 189 |
\noindent\textbf{Text and policy:} |
| 190 |
|
| 191 |
\medskip |
| 192 |
\noindent\dnsTXT{example.com}{v=spf1 mx -all}[300] |
| 193 |
|
| 194 |
\medskip |
| 195 |
\noindent\dnsCAA{example.com}{0 issue}{letsencrypt.org}[3600] |
| 196 |
|
| 197 |
\bigskip |
| 198 |
\noindent\textbf{Authority:} |
| 199 |
|
| 200 |
\medskip |
| 201 |
\noindent\dnsSOA{example.com}{ns1.example.com}{admin.example.com}[86400] |
| 202 |
|
| 203 |
\subsection{DNSSEC record types} |
| 204 |
|
| 205 |
\medskip |
| 206 |
\noindent\dnsDNSKEY{example.com}{257 3 13 (base64key...)}[86400] |
| 207 |
|
| 208 |
\medskip |
| 209 |
\noindent\dnsDS{example.com}{12345 13 2 (digest...)}[86400] |
| 210 |
|
| 211 |
\medskip |
| 212 |
\noindent\dnsRRSIG{example.com}{A 13 2 300 (sig...)}[300] |
| 213 |
|
| 214 |
\medskip |
| 215 |
\noindent\dnsNSEC{example.com}{www.example.com A AAAA RRSIG}[300] |
| 216 |
|
| 217 |
\medskip |
| 218 |
\noindent\dnsNSEC3{example.com}{1 0 10 ABCDEF (hash...)}[300] |
| 219 |
|
| 220 |
\subsection{Modern record types} |
| 221 |
|
| 222 |
\medskip |
| 223 |
\noindent\dnsTLSA{\_443.\_tcp.example.com}{3 1 1 (hash...)}[3600] |
| 224 |
|
| 225 |
\medskip |
| 226 |
\noindent\dnsHTTPS{example.com}{1 . alpn=h2,h3 ipv4hint=93.184.216.34}[300] |
| 227 |
|
| 228 |
\medskip |
| 229 |
\noindent\dnsSVCB{example.com}{1 . alpn=h2}[300] |
| 230 |
|
| 231 |
\subsection{Email authentication records} |
| 232 |
|
| 233 |
\medskip |
| 234 |
\noindent\dnsSPF{example.com}{v=spf1 include:mail.example.com -all}[300] |
| 235 |
|
| 236 |
\medskip |
| 237 |
\noindent\dnsDKIM{s1.\_domainkey.example.com}{v=DKIM1; k=rsa; p=MIGf...}[3600] |
| 238 |
|
| 239 |
\medskip |
| 240 |
\noindent\dnsDMARC{\_dmarc.example.com}{v=DMARC1; p=reject; rua=mailto:[email protected]}[3600] |
| 241 |
|
| 242 |
\subsection{Command reference} |
| 243 |
|
| 244 |
\begin{Verbatim}[frame=single,fontsize=\small] |
| 245 |
% Standard records |
| 246 |
\dnsA{name}{ip}[ttl] |
| 247 |
\dnsAAAA{name}{ipv6}[ttl] |
| 248 |
\dnsCNAME{alias}{canonical}[ttl] |
| 249 |
\dnsMX{name}{priority}{mailserver}[ttl] |
| 250 |
\dnsNS{name}{nameserver}[ttl] |
| 251 |
\dnsTXT{name}{text}[ttl] |
| 252 |
\dnsSOA{name}{primary-ns}{admin-email}[ttl] |
| 253 |
\dnsPTR{reverse-ip}{hostname}[ttl] |
| 254 |
\dnsSRV{name}{priority}{target}{port}[ttl] |
| 255 |
\dnsCAA{name}{flags-tag}{value}[ttl] |
| 256 |
|
| 257 |
% DNSSEC records |
| 258 |
\dnsDNSKEY{name}{flags-proto-algo-key}[ttl] |
| 259 |
\dnsDS{name}{keytag-algo-digest-type-digest}[ttl] |
| 260 |
\dnsRRSIG{name}{type-algo-labels-ttl-sig}[ttl] |
| 261 |
\dnsNSEC{name}{next-domain-types}[ttl] |
| 262 |
\dnsNSEC3{name}{algo-flags-iter-salt-hash}[ttl] |
| 263 |
|
| 264 |
% Modern records |
| 265 |
\dnsTLSA{name}{usage-selector-matching-data}[ttl] |
| 266 |
\dnsHTTPS{name}{priority-target-params}[ttl] |
| 267 |
\dnsSVCB{name}{priority-target-params}[ttl] |
| 268 |
|
| 269 |
% Email authentication |
| 270 |
\dnsSPF{name}{policy}[ttl] |
| 271 |
\dnsDKIM{selector._domainkey.name}{policy}[ttl] |
| 272 |
\dnsDMARC{_dmarc.name}{policy}[ttl] |
| 273 |
\end{Verbatim} |
| 274 |
|
| 275 |
% ================================================================ |
| 276 |
\section{Zone File Tables} |
| 277 |
% ================================================================ |
| 278 |
|
| 279 |
The \texttt{dnszone} environment creates a formatted table for an entire |
| 280 |
DNS zone, automatically counting records. |
| 281 |
|
| 282 |
\begin{Verbatim}[frame=single] |
| 283 |
\begin{dnszone}{example.com} |
| 284 |
\dnsentry{A}{@}{93.184.216.34}[300] |
| 285 |
\dnsentry{AAAA}{@}{2606:2800:220:1::1946}[300] |
| 286 |
\dnsentry{CNAME}{www}{example.com}[3600] |
| 287 |
\dnsentry{MX}{@}{mail.example.com (pri 10)}[3600] |
| 288 |
\dnsentry{NS}{@}{ns1.example.com}[86400] |
| 289 |
\dnsentry{NS}{@}{ns2.example.com}[86400] |
| 290 |
\dnsentry{TXT}{@}{v=spf1 mx -all}[300] |
| 291 |
\dnsentry{CAA}{@}{0 issue letsencrypt.org}[3600] |
| 292 |
\end{dnszone} |
| 293 |
\end{Verbatim} |
| 294 |
|
| 295 |
\bigskip |
| 296 |
\begin{dnszone}{example.com} |
| 297 |
\dnsentry{A}{@}{93.184.216.34}[300] |
| 298 |
\dnsentry{AAAA}{@}{2606:2800:220:1::1946}[300] |
| 299 |
\dnsentry{CNAME}{www}{example.com}[3600] |
| 300 |
\dnsentry{MX}{@}{mail.example.com (pri 10)}[3600] |
| 301 |
\dnsentry{NS}{@}{ns1.example.com}[86400] |
| 302 |
\dnsentry{NS}{@}{ns2.example.com}[86400] |
| 303 |
\dnsentry{TXT}{@}{v=spf1 mx -all}[300] |
| 304 |
\dnsentry{CAA}{@}{0 issue letsencrypt.org}[3600] |
| 305 |
\end{dnszone} |
| 306 |
|
| 307 |
\bigskip |
| 308 |
A more complex example with DNSSEC records: |
| 309 |
|
| 310 |
\bigskip |
| 311 |
\begin{dnszone}{secure.example.com} |
| 312 |
\dnsentry{A}{@}{198.51.100.1}[300] |
| 313 |
\dnsentry{AAAA}{@}{2001:db8::1}[300] |
| 314 |
\dnsentry{NS}{@}{ns1.secure.example.com}[86400] |
| 315 |
\dnsentry{NS}{@}{ns2.secure.example.com}[86400] |
| 316 |
\dnsentry{DNSKEY}{@}{257 3 13 (KSK base64...)}[86400] |
| 317 |
\dnsentry{DNSKEY}{@}{256 3 13 (ZSK base64...)}[86400] |
| 318 |
\dnsentry{DS}{@}{12345 13 2 (digest...)}[86400] |
| 319 |
\dnsentry{RRSIG}{@}{A 13 3 300 (signature...)}[300] |
| 320 |
\dnsentry{NSEC}{@}{www.secure.example.com A AAAA NS}[300] |
| 321 |
\end{dnszone} |
| 322 |
|
| 323 |
% ================================================================ |
| 324 |
\section{Propagation Status Tables} |
| 325 |
% ================================================================ |
| 326 |
|
| 327 |
The \texttt{dnspropagation} environment displays DNS record propagation |
| 328 |
across multiple global resolver locations. This is useful for documenting |
| 329 |
DNS migration events, TTL behavior analysis, or troubleshooting reports. |
| 330 |
|
| 331 |
\begin{Verbatim}[frame=single] |
| 332 |
\begin{dnspropagation}{example.com}{A} |
| 333 |
\dnsserver{Google}{8.8.8.8}{93.184.216.34}{5ms}{propagated} |
| 334 |
\dnsserver{Cloudflare}{1.1.1.1}{93.184.216.34}{3ms}{propagated} |
| 335 |
\dnsserver{Quad9}{9.9.9.9}{93.184.216.34}{8ms}{propagated} |
| 336 |
\dnsserver{OpenDNS}{208.67.222.222}{93.184.216.34}{12ms}{propagated} |
| 337 |
\dnsserver{ISP Germany}{194.25.0.60}{93.184.216.33}{45ms}{pending} |
| 338 |
\dnsserver{ISP France}{80.10.246.2}{---}{---}{failed} |
| 339 |
\dnsserver{ISP Japan}{210.171.224.1}{---}{120ms}{timeout} |
| 340 |
\end{dnspropagation} |
| 341 |
\end{Verbatim} |
| 342 |
|
| 343 |
\bigskip |
| 344 |
\begin{dnspropagation}{example.com}{A} |
| 345 |
\dnsserver{Google}{8.8.8.8}{93.184.216.34}{5ms}{propagated} |
| 346 |
\dnsserver{Cloudflare}{1.1.1.1}{93.184.216.34}{3ms}{propagated} |
| 347 |
\dnsserver{Quad9}{9.9.9.9}{93.184.216.34}{8ms}{propagated} |
| 348 |
\dnsserver{OpenDNS}{208.67.222.222}{93.184.216.34}{12ms}{propagated} |
| 349 |
\dnsserver{ISP Germany}{194.25.0.60}{93.184.216.33}{45ms}{pending} |
| 350 |
\dnsserver{ISP France}{80.10.246.2}{---}{---}{failed} |
| 351 |
\dnsserver{ISP Japan}{210.171.224.1}{---}{120ms}{timeout} |
| 352 |
\end{dnspropagation} |
| 353 |
|
| 354 |
\bigskip |
| 355 |
The status indicators use color-coded bullets: |
| 356 |
\dnsstatus{propagated}, \dnsstatus{pending}, \dnsstatus{failed}, \dnsstatus{timeout}. |
| 357 |
|
| 358 |
% ================================================================ |
| 359 |
\section{DNSSEC Chain of Trust} |
| 360 |
% ================================================================ |
| 361 |
|
| 362 |
The \texttt{dnssecchain} environment visualizes the DNSSEC delegation |
| 363 |
chain from root to target domain: |
| 364 |
|
| 365 |
\begin{Verbatim}[frame=single] |
| 366 |
\begin{dnssecchain}{example.com} |
| 367 |
\dnssecentry{. (root)}{DNSKEY}{20326}{RSASHA256} |
| 368 |
\dnssecentry{. (root)}{DS}{20326}{RSASHA256} |
| 369 |
\dnssecentry{com.}{DNSKEY}{30909}{ECDSAP256SHA256} |
| 370 |
\dnssecentry{com.}{DS}{30909}{ECDSAP256SHA256} |
| 371 |
\dnssecentry{example.com.}{DNSKEY}{12345}{ECDSAP256SHA256} |
| 372 |
\dnssecentry{example.com.}{RRSIG}{12345}{ECDSAP256SHA256} |
| 373 |
\end{dnssecchain} |
| 374 |
\end{Verbatim} |
| 375 |
|
| 376 |
\bigskip |
| 377 |
\begin{dnssecchain}{example.com} |
| 378 |
\dnssecentry{. (root)}{DNSKEY}{20326}{RSASHA256} |
| 379 |
\dnssecentry{. (root)}{DS}{20326}{RSASHA256} |
| 380 |
\dnssecentry{com.}{DNSKEY}{30909}{ECDSAP256SHA256} |
| 381 |
\dnssecentry{com.}{DS}{30909}{ECDSAP256SHA256} |
| 382 |
\dnssecentry{example.com.}{DNSKEY}{12345}{ECDSAP256SHA256} |
| 383 |
\dnssecentry{example.com.}{RRSIG}{12345}{ECDSAP256SHA256} |
| 384 |
\end{dnssecchain} |
| 385 |
|
| 386 |
\bigskip |
| 387 |
DNSSEC validation status indicators: |
| 388 |
|
| 389 |
\medskip |
| 390 |
\noindent\dnssec{valid} \qquad \dnssec{invalid} \qquad \dnssec{unsigned} \qquad \dnssec{insecure} |
| 391 |
|
| 392 |
% ================================================================ |
| 393 |
\section{DNS Health Check Reports} |
| 394 |
% ================================================================ |
| 395 |
|
| 396 |
The \texttt{dnshealthcheck} environment creates a diagnostic report |
| 397 |
format commonly used in DNS audits: |
| 398 |
|
| 399 |
\begin{Verbatim}[frame=single] |
| 400 |
\begin{dnshealthcheck}{example.com} |
| 401 |
\dnshealthitem{healthy}{All nameservers responding} |
| 402 |
\dnshealthitem{healthy}{SOA serial numbers consistent} |
| 403 |
\dnshealthitem{healthy}{MX records resolve to valid IPs} |
| 404 |
\dnshealthitem{warning}{TTL for A record is below 300s} |
| 405 |
\dnshealthitem{warning}{No IPv6 (AAAA) record found} |
| 406 |
\dnshealthitem{critical}{DNSSEC signatures expired} |
| 407 |
\dnshealthitem{critical}{Open resolver detected on ns2} |
| 408 |
\dnshealthitem{info}{Domain registered until 2028-01-15} |
| 409 |
\end{dnshealthcheck} |
| 410 |
\end{Verbatim} |
| 411 |
|
| 412 |
\begin{dnshealthcheck}{example.com} |
| 413 |
\dnshealthitem{healthy}{All nameservers responding} |
| 414 |
\dnshealthitem{healthy}{SOA serial numbers consistent across all NS} |
| 415 |
\dnshealthitem{healthy}{MX records resolve to valid IP addresses} |
| 416 |
\dnshealthitem{warning}{TTL for A record is below recommended 300s minimum} |
| 417 |
\dnshealthitem{warning}{No IPv6 (AAAA) record found for root domain} |
| 418 |
\dnshealthitem{critical}{DNSSEC RRSIG signatures have expired} |
| 419 |
\dnshealthitem{critical}{Open resolver detected on ns2.example.com} |
| 420 |
\dnshealthitem{info}{Domain registration expires 2028-01-15} |
| 421 |
\end{dnshealthcheck} |
| 422 |
|
| 423 |
% ================================================================ |
| 424 |
\section{Email Authentication Summary} |
| 425 |
% ================================================================ |
| 426 |
|
| 427 |
The \texttt{dnsemailauth} environment displays SPF, DKIM, and DMARC |
| 428 |
configuration status for a domain: |
| 429 |
|
| 430 |
\begin{Verbatim}[frame=single] |
| 431 |
\begin{dnsemailauth}{example.com} |
| 432 |
\dnsemailentry{SPF}{v=spf1 mx -all}{Strict}{propagated} |
| 433 |
\dnsemailentry{DKIM}{v=DKIM1; k=rsa; p=MIGf...}{2048-bit RSA}{propagated} |
| 434 |
\dnsemailentry{DMARC}{v=DMARC1; p=reject}{Reject}{propagated} |
| 435 |
\dnsemailentry{MX}{mail.example.com (pri 10)}{Primary}{propagated} |
| 436 |
\dnsemailentry{TLSA}{3 1 1 (cert hash...)}{DANE}{pending} |
| 437 |
\end{dnsemailauth} |
| 438 |
\end{Verbatim} |
| 439 |
|
| 440 |
\bigskip |
| 441 |
\begin{dnsemailauth}{example.com} |
| 442 |
\dnsemailentry{SPF}{v=spf1 mx -all}{Strict}{propagated} |
| 443 |
\dnsemailentry{DKIM}{v=DKIM1; k=rsa; p=MIGf...}{2048-bit RSA}{propagated} |
| 444 |
\dnsemailentry{DMARC}{v=DMARC1; p=reject}{Reject}{propagated} |
| 445 |
\dnsemailentry{MX}{mail.example.com (pri 10)}{Primary}{propagated} |
| 446 |
\dnsemailentry{TLSA}{3 1 1 (cert hash...)}{DANE}{pending} |
| 447 |
\end{dnsemailauth} |
| 448 |
|
| 449 |
% ================================================================ |
| 450 |
\section{DNS Latency Comparison} |
| 451 |
% ================================================================ |
| 452 |
|
| 453 |
The \texttt{dnslatency} environment compares response times across |
| 454 |
DNS resolvers: |
| 455 |
|
| 456 |
\begin{Verbatim}[frame=single] |
| 457 |
\begin{dnslatency}{example.com} |
| 458 |
\dnslatencyentry{Cloudflare}{1.1.1.1}{2}{4}{8} |
| 459 |
\dnslatencyentry{Google}{8.8.8.8}{4}{7}{15} |
| 460 |
\dnslatencyentry{Quad9}{9.9.9.9}{5}{9}{18} |
| 461 |
\dnslatencyentry{OpenDNS}{208.67.222.222}{8}{14}{25} |
| 462 |
\dnslatencyentry{ISP Default}{192.168.1.1}{12}{35}{120} |
| 463 |
\end{dnslatency} |
| 464 |
\end{Verbatim} |
| 465 |
|
| 466 |
\bigskip |
| 467 |
\begin{dnslatency}{example.com} |
| 468 |
\dnslatencyentry{Cloudflare}{1.1.1.1}{2}{4}{8} |
| 469 |
\dnslatencyentry{Google}{8.8.8.8}{4}{7}{15} |
| 470 |
\dnslatencyentry{Quad9}{9.9.9.9}{5}{9}{18} |
| 471 |
\dnslatencyentry{OpenDNS}{208.67.222.222}{8}{14}{25} |
| 472 |
\dnslatencyentry{ISP Default}{192.168.1.1}{12}{35}{120} |
| 473 |
\end{dnslatency} |
| 474 |
|
| 475 |
% ================================================================ |
| 476 |
\section{DNS Provider Comparison} |
| 477 |
% ================================================================ |
| 478 |
|
| 479 |
\begin{Verbatim}[frame=single] |
| 480 |
\begin{dnsproviders} |
| 481 |
\dnsprovider{Cloudflare}{1.1.1.1}{1.0.0.1}{Yes}{DoH + DoT} |
| 482 |
\dnsprovider{Google}{8.8.8.8}{8.8.4.4}{Yes}{DoH + DoT} |
| 483 |
\dnsprovider{Quad9}{9.9.9.9}{149.112.112.112}{Yes}{DoH + DoT} |
| 484 |
\dnsprovider{OpenDNS}{208.67.222.222}{208.67.220.220}{No}{DoH} |
| 485 |
\dnsprovider{AdGuard}{94.140.14.14}{94.140.15.15}{Yes}{DoH + DoT} |
| 486 |
\end{dnsproviders} |
| 487 |
\end{Verbatim} |
| 488 |
|
| 489 |
\bigskip |
| 490 |
\begin{dnsproviders} |
| 491 |
\dnsprovider{Cloudflare}{1.1.1.1}{1.0.0.1}{Yes}{DoH + DoT} |
| 492 |
\dnsprovider{Google}{8.8.8.8}{8.8.4.4}{Yes}{DoH + DoT} |
| 493 |
\dnsprovider{Quad9}{9.9.9.9}{149.112.112.112}{Yes}{DoH + DoT} |
| 494 |
\dnsprovider{OpenDNS}{208.67.222.222}{208.67.220.220}{No}{DoH} |
| 495 |
\dnsprovider{AdGuard}{94.140.14.14}{94.140.15.15}{Yes}{DoH + DoT} |
| 496 |
\end{dnsproviders} |
| 497 |
|
| 498 |
% ================================================================ |
| 499 |
\section{TTL Visualization} |
| 500 |
% ================================================================ |
| 501 |
|
| 502 |
The \verb|\dnsttlbar| command creates a simple horizontal bar |
| 503 |
visualization for comparing TTL values: |
| 504 |
|
| 505 |
\begin{Verbatim}[frame=single] |
| 506 |
\dnsttlbar{A record}{300}{86400} |
| 507 |
\dnsttlbar{MX record}{3600}{86400} |
| 508 |
\dnsttlbar{NS record}{86400}{86400} |
| 509 |
\end{Verbatim} |
| 510 |
|
| 511 |
\bigskip |
| 512 |
\noindent\dnsttlbar{A record}{300}{86400} |
| 513 |
|
| 514 |
\medskip |
| 515 |
\noindent\dnsttlbar{MX record}{3600}{86400} |
| 516 |
|
| 517 |
\medskip |
| 518 |
\noindent\dnsttlbar{NS record}{86400}{86400} |
| 519 |
|
| 520 |
% ================================================================ |
| 521 |
\section{Utility Commands} |
| 522 |
% ================================================================ |
| 523 |
|
| 524 |
\subsection{Domain and IP formatting} |
| 525 |
|
| 526 |
\begin{Verbatim}[frame=single] |
| 527 |
\dnsdomain{example.com} % formatted domain name |
| 528 |
\dnsip{93.184.216.34} % formatted IP address |
| 529 |
\end{Verbatim} |
| 530 |
|
| 531 |
\noindent Result: \dnsdomain{example.com} \qquad \dnsip{93.184.216.34} |
| 532 |
|
| 533 |
\subsection{TTL with human-readable conversion} |
| 534 |
|
| 535 |
\begin{Verbatim}[frame=single] |
| 536 |
\dnsttl{300} \dnsttl{3600} \dnsttl{86400} |
| 537 |
\end{Verbatim} |
| 538 |
|
| 539 |
\noindent Result: \dnsttl{300} \qquad \dnsttl{3600} \qquad \dnsttl{86400} |
| 540 |
|
| 541 |
\subsection{DNS response codes} |
| 542 |
|
| 543 |
\begin{Verbatim}[frame=single] |
| 544 |
\dnsrcode{NOERROR} \dnsrcode{NXDOMAIN} \dnsrcode{SERVFAIL} \dnsrcode{REFUSED} |
| 545 |
\end{Verbatim} |
| 546 |
|
| 547 |
\noindent Result: \dnsrcode{NOERROR} \quad \dnsrcode{NXDOMAIN} \quad |
| 548 |
\dnsrcode{SERVFAIL} \quad \dnsrcode{REFUSED} |
| 549 |
|
| 550 |
\subsection{DNS flags} |
| 551 |
|
| 552 |
\begin{Verbatim}[frame=single] |
| 553 |
\dnsflag{QR} \dnsflag{AA} \dnsflag{RD} \dnsflag{RA} \dnsflag{AD} \dnsflag{CD} |
| 554 |
\end{Verbatim} |
| 555 |
|
| 556 |
\noindent Result: \dnsflag{QR} \dnsflag{AA} \dnsflag{RD} \dnsflag{RA} |
| 557 |
\dnsflag{AD} \dnsflag{CD} |
| 558 |
|
| 559 |
\subsection{DNS query/response header} |
| 560 |
|
| 561 |
\begin{Verbatim}[frame=single] |
| 562 |
\dnsheader{12345}{QUERY}{NOERROR}{QR RD RA AD} |
| 563 |
\end{Verbatim} |
| 564 |
|
| 565 |
\dnsheader{12345}{QUERY}{NOERROR}{QR RD RA AD} |
| 566 |
|
| 567 |
% ================================================================ |
| 568 |
\section{Real-World Examples} |
| 569 |
% ================================================================ |
| 570 |
|
| 571 |
\subsection{Example 1: Documenting a DNS migration} |
| 572 |
|
| 573 |
When migrating \dnsdomain{company.com} from Provider A to Provider B, |
| 574 |
the following propagation results were observed 30 minutes after the |
| 575 |
NS record change (\dnsttl{3600} TTL): |
| 576 |
|
| 577 |
\bigskip |
| 578 |
\begin{dnspropagation}{company.com}{NS} |
| 579 |
\dnsserver{Google}{8.8.8.8}{ns1.providerb.com}{5ms}{propagated} |
| 580 |
\dnsserver{Cloudflare}{1.1.1.1}{ns1.providerb.com}{3ms}{propagated} |
| 581 |
\dnsserver{Quad9}{9.9.9.9}{ns1.providera.com}{8ms}{pending} |
| 582 |
\dnsserver{ISP Germany}{194.25.0.60}{ns1.providera.com}{45ms}{pending} |
| 583 |
\dnsserver{ISP Brazil}{200.221.11.101}{ns1.providera.com}{180ms}{pending} |
| 584 |
\end{dnspropagation} |
| 585 |
|
| 586 |
\subsection{Example 2: Security audit report} |
| 587 |
|
| 588 |
DNS security assessment for \dnsdomain{bank.example.com}: |
| 589 |
|
| 590 |
\begin{dnshealthcheck}{bank.example.com} |
| 591 |
\dnshealthitem{healthy}{DNSSEC fully deployed with ECDSAP256SHA256} |
| 592 |
\dnshealthitem{healthy}{CAA record restricts issuance to approved CAs} |
| 593 |
\dnshealthitem{healthy}{SPF, DKIM, and DMARC all configured with strict policies} |
| 594 |
\dnshealthitem{healthy}{DANE/TLSA record published for SMTP} |
| 595 |
\dnshealthitem{warning}{SOA refresh interval (3600s) below recommended 7200s} |
| 596 |
\dnshealthitem{critical}{Zone transfer (AXFR) permitted from any source} |
| 597 |
\dnshealthitem{info}{4 nameservers across 2 autonomous systems} |
| 598 |
\end{dnshealthcheck} |
| 599 |
|
| 600 |
\subsection{Example 3: Email deliverability investigation} |
| 601 |
|
| 602 |
Email authentication configuration for \dnsdomain{newsletter.example.com}: |
| 603 |
|
| 604 |
\bigskip |
| 605 |
\begin{dnsemailauth}{newsletter.example.com} |
| 606 |
\dnsemailentry{SPF}{v=spf1 include:sendgrid.net -all}{Strict (-all)}{propagated} |
| 607 |
\dnsemailentry{DKIM}{v=DKIM1; k=rsa; p=MIGf...}{2048-bit RSA}{propagated} |
| 608 |
\dnsemailentry{DMARC}{v=DMARC1; p=quarantine; pct=100}{Quarantine}{propagated} |
| 609 |
\dnsemailentry{MX}{mx.sendgrid.net (pri 10)}{SendGrid}{propagated} |
| 610 |
\dnsemailentry{PTR}{mail.newsletter.example.com}{Reverse DNS}{failed} |
| 611 |
\end{dnsemailauth} |
| 612 |
|
| 613 |
\medskip |
| 614 |
\noindent The missing PTR record (\dnsrcode{NXDOMAIN}) for the sending IP |
| 615 |
is likely causing deliverability issues with strict mail servers. |
| 616 |
|
| 617 |
% ================================================================ |
| 618 |
\section{Compatibility} |
| 619 |
% ================================================================ |
| 620 |
|
| 621 |
The \texttt{dnsrecord} package has been tested with: |
| 622 |
|
| 623 |
\begin{itemize}[nosep] |
| 624 |
\item \textbf{TeX Live} 2022--2026 |
| 625 |
\item \textbf{MiKTeX} 22.1+ |
| 626 |
\item \textbf{Overleaf} (online) |
| 627 |
\item \texttt{pdflatex}, \texttt{xelatex}, and \texttt{lualatex} engines |
| 628 |
\item \texttt{article}, \texttt{report}, \texttt{book}, and \texttt{beamer} classes |
| 629 |
\end{itemize} |
| 630 |
|
| 631 |
% ================================================================ |
| 632 |
\section{Known Limitations} |
| 633 |
% ================================================================ |
| 634 |
|
| 635 |
\begin{itemize}[nosep] |
| 636 |
\item Long TXT record values may overflow table columns; consider using |
| 637 |
abbreviated values or the \texttt{compact} option |
| 638 |
\item The TTL bar visualization (\verb|\dnsttlbar|) uses fixed-width |
| 639 |
rendering and may not scale well for very large TTL differences |
| 640 |
\item Color-coded badges require a PDF-capable output driver |
| 641 |
\end{itemize} |
| 642 |
|
| 643 |
% ================================================================ |
| 644 |
\section{Changelog} |
| 645 |
% ================================================================ |
| 646 |
|
| 647 |
\begin{description}[nosep] |
| 648 |
\item[v1.0.0 (2026-03-09)] Initial release. 22 record types, |
| 649 |
7 environments, utility commands. |
| 650 |
\end{description} |
| 651 |
|
| 652 |
% ================================================================ |
| 653 |
\section{License} |
| 654 |
% ================================================================ |
| 655 |
|
| 656 |
This work is released under the \LaTeX{} Project Public License v1.3c |
| 657 |
or later. The full text is available at:\\ |
| 658 |
\url{https://www.latex-project.org/lppl.txt} |
| 659 |
|
| 660 |
% ================================================================ |
| 661 |
\section{Links and Contact} |
| 662 |
% ================================================================ |
| 663 |
|
| 664 |
\begin{description}[nosep,leftmargin=3cm] |
| 665 |
\item[Homepage] \url{https://dnsrobot.net} |
| 666 |
\item[Repository] \url{https://github.com/dnsrobot/latex-dnsrecord} |
| 667 |
\item[Bug reports] \url{https://github.com/dnsrobot/latex-dnsrecord/issues} |
| 668 |
\item[CTAN] \url{https://ctan.org/pkg/dnsrecord} |
| 669 |
\item[Author] Vahid Shaik --- \url{https://dnsrobot.net} |
| 670 |
\end{description} |
| 671 |
|
| 672 |
\end{document} |