DNS Flashcards
Understand DNS and how to configure it on Linux
What is name resolution
The process of translating names to IP address
At the top of the domain structure is the root domain (or “null”) This is typically written in documentation using which two notations
either ‘’ (that’s two single quotes) or
a single dot (.)
What is a TLD?
A top level domain, the level immediately below the root domain. Examples of TLD's are .com .co.uk .org etc.
What is a first-level domain?
that is the part of the domain name that preceedes the TLD. For example in
mydomain.com
“mydomain” is the first level domain.
A FQDN is usually made up of:
hostname.first-level-domain.TLD
What is a FQDN?
A fully qualified domain name, consists of hostname, domain name and top-level domain.
A FQDN is usually made up of:
hostname.first-level-domain.TLD
Technically, it should end with a period therefore:
forums. opensuse.org should be written as
forums. opensuse.org.
How many designated DNS managers manage to DNS root zone?
13
What is an authoritative data file?
It’s either a zone file or zone database. A zone define what the domain server has authority over.
What is a resolver?
a program or routine that forms a dns query
What is a Primary (Master) DNS Server?
A dns server that is considered authoritative as it has authority over one or more domains. The information it holds is known as authoritative information.
What is a secondary (Slave) DNS Server
a dns server that is optional (but recommended for all but the smallest of implementations). It is used to support the primary server and take some of the burden.
What is a caching DNS Server?
a dns server that receives information from an authoritative dns erver and caches the results to improve performance. Often used by ISPs
What is a Forwarding DNS server, how does it differ from a caching dns server?
Like a caching dns server, this doesn’t have authoritative domain data but caches requests for performance. In addition, if it doesn’t have the answer for a dns query, it will forward the request to another dns server.
What is a hybrid dns server?
a dns server that performs more than one role, for example a secondary slave server that is also a caching server
What is a stealth dns server?
a dns server that is not queried directly or is hidden behind a firewall. Stealth servers are often also hybrid dns servers.
What is a recursive Name Server?
a dns server that will answer queries from local cache. If the answer is not cached, the recursive server will start the process of resolving the query.
First by querying a root server for a dns server for the TLD.
Then querying the TLD server for a dns server for the first-level domain.
Then querying the zone server for the host IP.
So a single DNS request can spawn a number of DNS requests by the recursive dns server
BIND is popular name server on Linux, what does BIND stand for?
Berkeley Internet Name Domain
Apart from BIND, the LPIC exam requires awareness for 4 other dns alternatives - what are they?
djddns - collection of dns apps, including tinydns
dnsmasq - lightweight dns and DHCP server
pdnsd - dns utility, not a full dns server
PowerDNS - full dns
what is bindutils
package of dns tools useful for testing and troubleshooting dns
What packages for BIND would you on an RPM distro like Centos
yum install bind bind-utils
What packages for BIND would you on an deb distro like Ubuntu
apt-get install bind9 bind9utils
Where is the bind documentation likely to be?
/usr/share/doc/bind9
Where are the config files likely to be in
a) Centos and
b) Ubuntu?
a) /etc/named.conf
b) /etc/bind/named.conf or /etc/bind9/named.conf
Here is an example options section of a named.conf file
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
allow-query { localhost; };
recursion yes; dnssec-enable yes; dnssec-validation yes;
/* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic"; pid-file "/run/named/named.pid"; session-keyfile "/run/named/session.key"; };
Which interfaces is this server listening on?
Who is allowed to query the server?
Is the server caching queries?
The server is only listening on it’s local loopback network address (listen-on directive)
The server only allows queries from itself (allow-query directive)
The server is caching (Recursion yes; directive)
This is a snippet from named.conf - what is it and what does it do?
zone “.” IN {
type hint;
file “named.ca”;
};
This defines the root zone. The file named.ca contains the root server addresses. This allows our dns server to start revolving names for queries that are not cached.
This directive is often called “hint for root level servers”
What does the include directive do in named.conf?
Allows you to include separate files in the configuration so, the config can be split into multiple files to ease admin.
for example, bind9 on Ubuntu has a short named.conf file by default:
cat named.conf // This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local
include “/etc/bind/named.conf.options”;
include “/etc/bind/named.conf.local”;
include “/etc/bind/named.conf.default-zones”;
Which utility can be used to check the syntax of named.conf after making amendments?
named-checkconf
Where are the zone files likely to be in
a) Centos and
b) Ubuntu?
a) /var/named/
b) /etc/bind or /etc/bind9
To obtain the benefits of a caching server - it should be setup physically close the the network it is serving. How would you use an access control list (acl) to setup a caching dns server?
acl trustednet { 192.168.51.0/24; localhost; localnets; };
allow-query { trutednet; };
listen-on port 53 { trustednet; };
recursion yes;
How would you test your local bind server with nslookup?
nslookup www.brainscape.com 192.168.51.2
How would you test your local bind server with dig?
dig www.brainscape.com @192.168.51.2
or
dig +short +identify www.brainscape.com @192.168.51.2
To configure other linux systems to use your new dns server on older distros you would edit resolve.conf. However, many distros now overwrite that file on boot.
To make the change permanent, which files would you edit on recent Centos and Ubuntu distros?
On Centos:
/etc/sysconfig/network-scripts/[interface-name]
change or add entry for DNS1 or DNS2
e.g. DNS1 = 192.168.51.2
On Ubuntu:
/etc/network/interfaces
add/amend entry for dns-nameservers
e.g dns-nameservers 192.168.51.2 192.168.0.1
Using rndc, how do you stop, start and restart bind?
stop: rndc stop
restart: rndc restart
start: can’t be done with rndc currently
Using ststemctl, how do you stop, start and restart bind?
systemctl start named (or bind)
systemctl reload named
systemctl stop named
How would you stop bind using signal interrupt or signal hangup?
kill -s SIGHUP $(cat /run/named/named.pid)
kill -s SIGINT $(cat /run/named/named.pid)
Although…. best method for controlling bind is now rndc
How would you reload binds config files using rndc?
rndc reload
How would you reload a single zone using rndc?
rndc reload [zonename]
How would you stop bing saving any pending updates using rndc?
rndc stop
How would you stop bing without saving any pending updates using rndc?
rndc halt
How would you flush binds cache using rndc?
rndc flush
How would you flush binds cache for a single domain using rndc?
rndc flushname [domainname]