Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configuration method of Ubuntu DNS server

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the configuration method of Ubuntu DNS server". In the daily operation, I believe that many people have doubts about the configuration method of Ubuntu DNS server. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "configuration method of Ubuntu DNS server". Next, please follow the editor to study!

Configure the primary Ubuntu DNS server

First of all, let's make the following assumptions: server An is the primary domain name server of 21php.com, and its IP address is 11.0.0.1. The B server is the secondary domain name server of 21php.com, and its IP address is 11.0.0.2.

Let's configure server 11.0.0.1 as the primary Ubuntu DNS server for 21PHP.COM

The Ubuntu DNS function under Linux is realized by bind software. After the bind software is installed, there are several inherent files, which are divided into two categories, one is the configuration file in the / etc directory, the other is the Ubuntu DNS record file in the / var/named directory. Add other related files to set up the Ubuntu DNS server together. The following is a list and description of all files related to Ubuntu DNS settings.

Located in the / etc directory are: hosts,host.conf,resolv.conf,named.boot,named.conf.

1. The "hosts" file, which defines the correspondence between the host name and the ip address, including the ip address and host name of the computer that will be running Ubuntu DNS. Content: 127.0.0.1 localhost.localdomain localhost

2. "host.conf" file [Boban Note: originally miswritten as hosts.conf], "order hosts bind" statement specifies that the resolution order of the host name is to first look up the host name in hosts, and then look it up in the record of the Ubuntu DNS server. "multi on" allows a host name to correspond to multiple ip addresses. Content:

Order hosts, bind

Multi on

Nospoof on

3. "resolv.conf" file, "nameserver 10.0.0.211" specifies the address of the Ubuntu DNS server. Note that this file is essential for ordinary computers that are not Ubuntu DNS servers (non-windows systems; Windows systems are set in "network properties"). If you do not set this machine as a Ubuntu DNS server, and you want to be able to resolve domain names, you must specify the address of a Ubuntu DNS server. You can write up to three addresses as a candidate Ubuntu DNS server for the previous failure. "domain zrs.com" specifies the default domain. Contents of the file:

Domain 21php.com

Nameserver 11.0.0.1

4. The "named.boot" file is the configuration file used by the earlier version of bind software, but now it has given way to "named.conf" in the new version. Named.conf is the core file of Ubuntu DNS server configuration. Let's explain it paragraph by paragraph.

Named.conf-configuration for bind

Generated automatically by bindconf, alchemist et al.

Controls {inet 127.0.0.1 allow {localhost;} keys {rndckey;};}

Include "/ etc/rndc.key"; options {directory "/ var/named/";}

Zone "." {type hint; file "named.ca";}

Zone "0.0.127.in-addr.arpa" {type master; file "0.0.127.in-addr.arpa.zone";}

Zone "localhost" {type master; file "localhost.zone";}

Zone "21php.com" {type master; notify yes; file "21php.com";}

The above # is a comment symbol, and the other lines have the following meanings:

Diretory / var/named specifies that named reads Ubuntu DNS data files from the / var/named directory. Users can specify and create this directory. All Ubuntu DNS data files are stored in this directory.

Zone "." {type hint; file "named.ca";}

Specifies that named obtains the top-level "root" server address of Internet from the named.ca file.

Zone "0.0.127.in-addr.arpa" {type master; file "0.0.127.in-addr.arpa.zone";}

Specify named as the primary server for 127.0.0 network segment address translation. The named.local file contains address-to-domain name translation data in the form of 127.0.0.* (127.0.0 network segment address is the internal loopback address of the LAN interface).

Zone "localhost" {type master; file "localhost.zone";}

Specifies that the Ubuntu DNS file data containing localhost is stored in / var/named/localhost.zone

Zone "21php.com" {type master; notify yes; file "21php.com.zone";}

The above statement indicates that the Ubuntu DNS data of the domain 21php.com is stored in 21php.com.zone under the / var/named/ directory

We can open / var/named/21php.com.zone with a text editor, which reads as follows:

$TTL 86400 @ IN SOA @ root.localhost (2; serial 28800; refresh 7200; retry 604800; expire 86400; ttl)

@ IN NS localhost

Www IN A 11.0.0.233

Www2 IN A 11.0.0.23

Forum IN A 11.0.0.10

@ IN MX 5 mail.21php.com.

The first part of the file is the corresponding parameter settings, this part does not need to be changed, the following part is the specific Ubuntu DNS data

For example:

Www IN A 11.0.0.233

Resolve www.21php.com to address 11.0.0.233

Www2 IN A 11.0.0.23

Resolve www2.21php.com to address 11.0.0.23

Club IN A 11.0.0.10

Resolve club.21php.com to address 11.0.0.10

At this point, the study on the "configuration method of Ubuntu DNS server" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report