What is DNS The full name of DNS is Domain Name System, which means domain name resolution system. Its responsibility is to translate domain names into recognizable IP addresses for different computer devices to connect to. Linux DNS resolution configuration and files There are three files in Linux related to DNS resolution:
/etc/resolv.conf is used to configure the DNS domain name and IP address. There is a lot of information on the Internet for reference. How a domain name is resolved How the Domain Name System (DNS) Works explains the process of how a domain name is resolved, which can be basically divided into:
Simple DNS configuration example (based on CentOs7) Server Side 1. Install bind 2. Modify the /etc/named.conf configuration file vim /etc/named.conf options { listen-on port 53 { any; }; //Open listening port 53 and accept any IP connection listen-on-v6 port 53 { ::1; }; //Support IP V6 directory "/var/named"; //All forward and reverse zone files are created in this directory 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 { 0.0.0.0/0; }; //Allow any IP to query recursion yes; dnssec-enable yes; dnssec-validation yes; dnssec-lookaside auto; /* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key"; managed-keys-directory "/var/named/dynamic"; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "." IN { type hint; file "named.ca"; }; include "/etc/named.rfc1912.zones"; //Main configuration file include "/etc/named.root.key"; 3. Modify the /etc/named.rfc1912.zones file and add the forward zone of duiyi.com vim /etc/ named.rfc1912.zones zone "localhost.localdomain" IN { type master; file "named.localhost"; allow-update { none; }; }; zone "localhost" IN { type master; file "named.localhost"; allow-update { none; }; }; zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { type master; file "named.loopback"; allow-update { none; }; }; zone "1.0.0.127.in-addr.arpa" IN { type master; file "named.loopback"; allow-update { none; }; }; zone "0.in-addr.arpa" IN { type master; file "named.empty"; allow-update { none; }; }; //duiyi.com's positive zone zone "duiyi.com" IN { type master; file "duiyi.com.zone"; allow-update { none; }; }; 4. Create a forward zone resource file vim /var/named/duiyi.com.zone $TTL 1D @ IN SOA duiyi.com. rname.invalid. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS@ A 127.0.0.1 AAAA::1 www IN A 192.168.81.1 mail IN A 192.168.81.2 ftp IN A 192.168.81.3 5. Start the named service 6. Start automatically at boot ## Client operating system: Both Windows and Linux are acceptable 1. Modify DNS: 2. Ping the server IP (192.168.81.133) to test whether the server can be accessed 3. Use the nslookup command to test whether the three DNS resolutions are successful As shown in the figure, it means that the DNS forward resolution is successful Linux as client test: 1. Install the bind-utils package so that you can use the nslookup, dig, and host tools 2. Modify the DNS configuration to use our DNS server vim /etc/resolv.conf nameserver 192.168.81.133 nameserver 114.114.114.114 nameserver 8.8.8.8 3. Forward resolution test, use the nslookup command (same as the windows test) Summarize The above is the Linux domain name service DNS configuration method introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: react-diagram serialization Json interpretation case analysis
>>: MySQL 8.0.12 Installation and Configuration Tutorial
To debug js code, you need to write debugger in t...
Template 1: login.vue <template> <p clas...
Free points Interviewer : Have you ever used Linu...
Table of contents 1. List interface display examp...
First, let's look at an example of memory rel...
1. Introduction to compression and packaging Comm...
The overall architecture of NGINX is characterize...
There was an article about the execution process ...
Sometimes in a project, due to some irreversible ...
Preface Previously, static IPs assigned using pip...
Docker only maps ports to IPv6 but not to IPv4 St...
Add secure_file_priv = ' '; then run cmd ...
It is difficult to find good image material websi...
Script requirements: Back up the MySQL database e...
The solution to the transparent font problem after...