In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to build and use DNS server under Linux. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
DNS (Domain Name System, Domain name system), whose main function is to resolve the host name to the IP address, completes the conversion from the domain name to the host recognition ip address.
Installation of general operation software package for DNS server under Linux
Various versions of Red Hat Linux already include the DNS server software-Bind. Generally, users do not need to install the latest version. If you need to install the latest version, you can go to the Bind official website http://www.bind.com/ to browse the latest news. It can also be downloaded from other websites.
Source code package: https://www.isc.org/downloads/
For example, download the source package package bind-9.10.4-P1.tar.gz from other websites
Here are some instructions during the installation process:
[root@localhost root] # tar xzvf bind-9.10.4-P1.tar.gz [root@localhost root] # cd bind-9.10.4-P1 [root@localhost bind-9.10.4-P1] #. / configure [root@localhost bind-9.10.4-P1] # make [root@localhost bind-9.10.4-P1] # make install
The meanings of the parameters are as follows:
Tar xzvf bind-9.10.4-P1.tar.gz / / extract the software package. / configure / / check and set up the installation for the machine, most of the work is automatically completed by the machine to complete the function of make / / compile make install / / install the software package
Bind: provides the main procedures of the domain name service and related documents.
Bind-utils: provides testing tools for DNS servers (nslookupdup, dig, etc.)
Bind-chroot: provides a disguised root directory for Bind to enhance security
Caching-namserver: provides the necessary default configuration file for configuring Bind as a cached domain name server for reference
General operation of DNS
1. Start the DNS server:
/ etc/init.d/named start
two。 Stop the DNS server:
/ etc/init.d/named stop
3. Restart the DNS server:
/ etc/init.d/named restartDNS configuration file
Two special files related to DNS
1./etc/resolv.conf
This file is used to specify the IP address and some related information of the DNS server in the system in the following format:
Search abc.com.cnnameserver 10.1.6.250nameserver 192.168.1.254
2./etc/host.conf
This file determines the order in which host files and DNS servers are searched for domain name resolution in the following format:
Order hosts,bind
Configuration file for Bind
The main configuration file for Bind is etc/name.conf, which is a text file and usually needs to be generated manually. Except for the main configuration file, all the files in the / var/named directory are related configuration files for the DNS server, and the configuration of these files is described in detail below.
Detailed explanation of 1.name.conf file
Options {listen-on port 53 {127.0.0.1;}; / / set the named server listening port and IP address listen-on-v6 port 53 {:: 1;}; directory "/ var/named"; / / set the default storage address for regional database files: 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;}; / / allow DNS to query client allow-query-cache {any;};}; logging {channel default_debug {file "data/named.run"; severity dynamic;};}; view localhost_resolver {match-clients {any;}; match-destinations {any;}; recursion yes / / set to allow recursive query include "/ etc/named.rfc1912.zones";}
two。 Zone profile / etc/named.rfc1912.zones
Zone "." IN {/ / defines the root domain type hint; / / defines the server type as hintfile "named.ca"; / / defines the configuration file name of the root domain}; zone "localdomain" IN {/ / defines the forward DNS zone type master; / / defines the zone type file "localdomain.zone"; / / sets the corresponding forward zone address database file allow-update {none;} / / set the client address that allows dynamic updates (none is prohibited)}; zone "localhost" IN {type master;file "localhost.zone"; allow-update {none;};}; zone "0.0.127.in-addr.arpa" IN {/ / set reverse DNS area type master;file "named.local"; allow-update {none;};}
3. Root domain profile named.ca
The root domain profile sets the domain name database of the root domain, including information about 13 DNS servers in the root domain. This file is the same for almost all systems, and users do not need to modify it.
4. Forward domain name resolution database file
$TTL 600 @ IN SOA dns.cwlinux.com dnsadmin.cwlinux.com. (/ / SOA field 2015031288 / / version number synchronization once + 1 1H / / update time 2m / / update failed Retry update time 2D / / how long after the update failed? the DNS expiration time is 1D / / the request cannot be resolved and the reply time is not answered.) IN NS dns / / there are two domain name servers IN NS ns2 IN MX 10 mial / / define mail server 10 refers to priority 0-99, the smaller the number, the higher the priority. Ns2 IN A 192.168.1.113 / / ip address of ns2 domain name server dns IN A 192.168.1.10 / / ip address of dns domain name server mail IN A 192.168.1.111 / / ip address of mail server www IN A 192.168.1.112 / www.cwlinux.com The official name of the ip address pop IN CNAME mail / / pop is mailftp IN CNAME www / / ftp and the official name is www
5. Reverse domain name resolution database file
$TTL 600 @ IN SOA dns.cwlinux.com. Dnsadmin.cwlinux.com. (2014031224 1H 2M 2D 1D) IN NS dns.cwlinux.com.10 IN PTR dns.cwlinux.com. / / reverse parsing PTR format 1111IN PTR mail.cwlinux.com.112 IN PTR www.cwlinux.com.// declaration domain already exists, 192.168.1, so we only need to enter 10 to represent the configuration file of the 192.168.1.10jcDNS client.
In Linux systems, the configuration file for the DNS client is / etc/resolv.conf, which records the address and domain name of the DNS server.
The general format is as follows:
# more / etc/resolv.confnameserver 10.1.6.250 domainname abc.com.cn
The keyword nameserver records the IP address of the DNS server in the domain, and the domainname records the name of the domain in which it is located.
These are all the contents of the article "how to build and use DNS Server under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.