Network-Guides

main DNS Repo

DNS

| Knowledge Base| Install | Test&Debug | Dynamic Updates & RNDC | Attack Vectors & Scenario | Protection |

Install

Preperation


############################################################################################################
#                                        /etc/resolv.conf 
#############################################################################################################
# Generated by NetworkManager
search speedport.ip
nameserver 192.168.122.7                   #    <----- THE IP OF OUR DNS
nameserver 2a02:3032:317:1192::92
nameserver 192.168.2.1
nameserver 192.168.61.86
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver fe80::1%enp2s0

this file will be constantly get resetted by NetworkManager, so we will need to add our Ip again later, but i wanted to explain this before we start the actual DNS-installation


## Install Bind9

  $  sudo apt-get install bind9 bind9utils bind9-doc
$ systemctl enable bind9
$ sudo systemctl enable named

configure your DNS

in our case we want to resolve foreman.de to the ip 192.168.122.20

############################################################################################################
#                                        /etc/bind/named.conf.options
#############################################################################################################

acl local-lan {
 localhost;
 192.168.1.0/24;
 192.168.122.0/24; # Netzwork for vmbr0
 192.168.123.0/24; # additional Networks 
};
options {
 directory "/var/cache/bind";
 forwarders {
192.168.61.86;    # the DNS my phone uses
192.168.2.1;      # the DNS of my NIC 
 };
 allow-query { local-lan; }; # Erlaubt Anfragen nur von den in local-lan definierten Netzwerken
 dnssec-validation auto;
 auth-nxdomain no;    // conform to RFC1035
 listen-on-v6 { any; };
 recursion no;  // we set that to no to avoid unnecessary traffic
 querylog yes; // Enable for debugging
 version "not available"; // Disable for security
};




############################################################################################################
#                                        /etc/bind/zones/foreman.de.rev
#############################################################################################################                                                                                         
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     foreman.de. root.foreman.de. (
                             1         ; Serial
                        604800         ; Refresh
                         86400         ; Retry
                       2419200         ; Expire
                        604800 )       ; Negative Cache TTL
;
; Name server record
@       IN      NS     bindserver.foreman.de.
; A record for name server
bindserver      IN      A      192.168.122.20
20.122.168.192.in-addr.arpa. IN PTR foreman.de.
@       IN      NS      localhost.
1.0.0   IN      PTR     localhost.

restart/refresh DNS

$ named-checkzone foreman.de /etc/bind/zones/foreman.de
$ named-checkzone foreman.de /etc/bind/zones/foreman.de.rev
$ named-checkconf /etc/bind/named.conf.options
$ named-checkconf
$ sudo systemctl restart bind9

Knowledge Base Install Test&Debug Dynamic Updates & RNDC Attack Vectors & Scenario Protection