Good to know : What is DNS and real world examples
A DNS server is a server that is used to translate IP addresses into host names so that they are more efficient and easy to remember. Apart from that, DNS is used to identify computers, services, and other resources that can be reached via the Internet or other Internet Protocol (IP) networks.
A simple example of implementing DNS, for example, is when you want to access a website like Google. By configuring the DNS server, you only need to type the address google.com, and not the IP 216.239.38.120, but you can still access the IP above to display pages from google.com.
Configuration
Debian11- Router
Install Packages
The DNS server is a large database that functions to store all the IP addresses used in hostnames. This large database contains a lot of information about IP addresses so when you visit a particular website. For example, youtube.com, the DNS server will translate it to YouTube's IP address.
apt install bind9 dnsutils
Copy File
Copy the db.local (File Forward) and db.127 (File Reverse) files into a new file. This is so that if there is a config error later, we still have a backup file.
;; BIND data file for local loopback interface;$TTL 604800@ IN SOA rizwanpemula.com. root.rizwanpemula.com. (2 ; Serial604800 ; Refresh86400 ; Retry2419200 ; Expire604800 ) ; Negative Cache TTL;@ IN NS ns1.rizwanpemula.com.@ IN A 20.1.1.1@ IN NS rizwanpemula.com.@ IN A 20.1.1.20ns1 IN A 20.1.1.1www IN A 20.1.1.20myweb IN A 20.1.1.20mail IN A 20.1.1.20php IN A 20.1.1.20phpmyadmin IN A 20.1.1.20wordpress IN A 20.1.1.20
;; BIND reverse data file for local loopback interface;$TTL 604800@ IN SOA rizwanpemula.com. root.rizwanpemula.com. (1 ; Serial604800 ; Refresh86400 ; Retry2419200 ; Expire604800 ) ; Negative Cache TTL;@ IN NS ns1.rizwanpemula.com.@ IN PTR rizwanpemula.com.20 IN PTR rizwanpemula.com.20 IN PTR www.rizwanpemula.com.20 IN PTR myweb.rizwanpemula.com.20 IN PTR mail.rizwanpemula.com.20 IN PTR php.rizwanpemula.com.20 IN PTR phpmyadmin.rizwanpemula.com.20 IN PTR wordpress.rizwanpemula.com.
zone "rizwanpemula.com"{type master; file "/etc/bind/db.rizwan";};zone "1.1.20.in-addr.arpa"{type master; file "/etc/bind/db.10";};
Now for Windows we need to fill in the DNS and Domain that we are going to. The method is Network Connection> Properties> Internet Protocol Version 4> Advance> DNS