RedHat6.2 server configuration Daquan - Chapter One: DNS This article comes from: http: //lslnet.com/linux/ Author: TANG Hai Jing (2001-09-28 07:00:00) (November 23, 2000 14 : 10)
Perhaps most readers have experience in installing DOS, Windows, but installing Linux is more complicated than they, you must have a certain understanding of your computer, and you must carefully protect your data, and do not operate at will.
Here, I introduce you to Red Hat Linux. Located in North Carol, Red Hat, since I came out since 1994, I have been using Linux as a goal, and the Red Hat Linux has become the best Linux distribution version, support more Many hardware, higher reliability, which is different from other Linux issued features based on "package", each package provides a full test, configured, ready-to-run software. If you want to try a new editor, install it, you can use it for a few seconds, want to delete it? A simple command can make it no trace.
Linux's software development is fast, even the core is true, so a release version will soon have a new version. Now, please recall, what did you do when you upgrade from Windows 3.1 to 95? The best situation also reloads all applications, or deletes all things on the hard disk, then start, this is a quite trouble, but if you use Red Hat Linux, you don't have to do this, it is based on The upgrade of the package is very easy, and you don't even have to restart your machine. Red Hat Software will always provide more convenient software for people using Linux.
This article will introduce you to the Configuration method of Linux servers through the theoretical connection, and the environment it applies, I hope the reader will quickly become a Linux Server administrator with this article.
Below I will introduce the configuration method of the following server-side software and its working principle:
Apache, DHCP, DNS, PPP, Sendmail, Samba, Squid, ISDN, MYSQL, Tomcat, PHP.
These configurations have basically covered all services required for small and medium-sized enterprise management and office. That is, if you have a configured configuration scheme and management method, you will also become a qualified SMEVER administrator. It is necessary to emphasize that there are too many configurable items in these profiles. There are many we can't use it, so in the subsequent article, I will choose to introduce it to everyone.
Related Tips:
1. You can query which RPM package belongs to this file using rpm -qf named.conf.
2. You can use rpm -qpl caching-nameserver-6.2-2.noarch.rpm to see which files are included in an RPM package.
3. You can use grep '^ [az]' httpd.conf to remove the annotation of a configuration file, because most configuration files are on the beginning of uppercase letters, so as long as the GREP's parameters will be used in the configuration file. Guided by the leader at the beginning of the uppercase letter AZ, it is possible, but if the configuration item starts with lowercase letters in the configuration file, it cannot be used like Named.conf.
4. NTSYSV can be executed under Linux to select the service item started by the server. Note: In most Linux release, the author has been fully considered, and it is preferred to choose Redhat in the publishing version regardless of the extensiveness of the system's stability, ease of use to applicable scope, so in the following article, I will use the Red Hat 6.2 as an example to help everyone become an excellent Linux Server Administer.
During the writing process of this article, the support of the colleagues of Lenovo Computer companies were obtained. Here, I would like to express my heartfelt thanks to the Software Business Department, Tianhui, Cao Yi, Shijinghai, Huang Jingchang, and the network of the Internet Division.
Since the author of this article is limited, there is a matter of some mistakes, please refer to the colleagues.
Chapter II: DNS 1.1 Simple Due to the TCP / IP network is the domain name resolution, that is, the user can access your website from both IP and URL. Moreover, domain name resolution should also provide a naming service for users, ie, user performs FTP 192.168.10.1, and performing FTP THJ.
1.2 Required System Resources 1.2.1 Profile:
Source of file name
/etc/named.conf caching-nameserver-6.2-2.noarch.rpm
/etc/named.boot caching-nameserver-6.2-2.noarch.rpm
/ etc / hosts system comes with
/etc/host.conf system comes with
/etc/resolv.conf system comes with
/etc/nsswitch.conf glibc-2.1.3-15
/VAR/NAMED/NAMED.LOCAL CACHING-NAMESERVER-6.2-2.NOARCH.RPM
/var/named/named.ca caching-nameserver-6.2-2.noarch.rpm
/VAR/NAMED/Name2ip.conf administrator created
/VAR/NAMED/IP2name.conf administrator created
1.2.2 Related Tools:
Source of file name
/etc/rc.d/init.d/named BIND-8.2.2_P5-9
/ usr / bin / nslookup bind-8.2.2_p5-9
/ usr / sbin / ndc bind-8.2.2_p5-9
1.3 Configuration Scheme For the configuration of the DNS server needs to involve 5 main files, and four files are also related to DNS:
1. /etc/named.conf configuration file
Role: Define the basic parameters and source points of the domain database information, which can be stored on a local or remote server.
Example:
Options {
DIRECTORY "/ var / named";
# Define the path to read and write files
}
"." {
Type hint;
# Indicates that the file that is used to initialize the domain name server at startup is a clue file.
Every server has a clue area.
File "named.ca";
# Specify the name of the file you want to read
}
Zone "0.0.127.in-addr.Arpa" {
TYPE MASTER;
# 表 表 The server is the primary domain server
File "named.local";
}
ZONE "mycompany.com" in {
TYPE MASTER;
File "Name2ip.conf";
}
Zone "10.168.192.in-addr.arpa" {
TYPE MASTER;
File "ip2name.conf";
}
2. /VAR/NAMED/Name2ip.conf forward parsing file
Role: Used to define domain information, realize the mirror between hostnames and addresses, identify the Mail server and provide various domain information.
Example:
@ In SOA THJ.MYCompany.com. Root.thj.mycompany.com.
# All zone files begin with SOA, @ designated current source, thj.mycompany.com
This value can connect the domain name and named.conf. Usually only one @ symbol.
(2000062900; Serial # serial number
28800; Refresh # refresh cycle, in seconds
14400; Retry # cycle cycle
3600000; EXPIRE # abort time
86400); MINUUM # time-to-Live time
In ns thr.mycompany.com.
# Define the domain name server
IN MX 10 THJ.MYCompany.com.
# Define the mail server, 10 indicates the priority, the smaller, the higher
Localhost in A 127.0.0.1
# Implement the mapping of the domain to IP
THJ I 192.168.10.1
WWW CNAME THJ
# Cc c 两 价 价 价
Mail CName THJ
3. /var/named/ip2name.conf reverse parsing file
Role: Implement a domain name for IP address
Example:
@ In SOA THJ.MYCompany.com. Root.thj.mycompany.com.
(2000062900; Serial
28800; Refresh
14400; RETRY
3600000; EXPIRE
86400); MINUUM
In ns thr.mycompany.com.
IN MX 10 THJ.MYCompany.com.
1 in ptr twj.mycompany.com.
# Define the reverse relationship, 192.168.10.1 and thj.mycompany.com
The mapping can also be used as a definition domain.
4. /var/named/named.local local host resolution file
Role: Analysis The return address localhost is 127.0.0.1, the return address is a special agreement, that is, the same as the method of processing the remote machine address when processing the local machine address, which simplifies the processing process without having to send data to the physical network. on.
Example:
@ In SOA localhost. Root.localhost.
1997022700; Serial
28800; Refresh
14400; RETRY
3600000; EXPIRE
86400); Minimum
IN ns localhost.
1 in ptr localhost.
5. /VAR/NAMED/Named.ca Cable File
Role: Initialize the information of the buffer. This file does not require administrator changes, but the system comes with.
Example:
. 3600000 in ns a.root-servers.net.
A. ROOT-SERVERS.NET. 3600000 A 198.41.0.4. 3600000 ns B.Root-servers.net.
B. ROOT-SERVERS.NET. 3600000 A 128.9.0.107
. 3600000 ns C.Root-servers.net.
C. ROOT-SERVERS.NET. 3600000 A 192.33.4.12
. 3600000 ns d.Root-servers.net.
D. ROOT-SERVERS.NET. 3600000 A 128.8.10.90
. 3600000 ns e.Root-servers.net.
E. ROOT-SERVERS.NET. 3600000 A 192.203.230.10
. 3600000 ns f.Root-servers.net.
F.Root-Servers.Net. 3600000 A 192.5.5.241
. 3600000 ns g.root-servers.net.
G.Root-servers.Net. 3600000 A 192.112.36.4
. 3600000 ns H.Root-servers.net.
H. ROOT-SERVERS.NET. 3600000 A 128.63.2.53
. 3600000 ns i.root-servers.net.
I. ROOT-SERVERS.NET. 3600000 A 192.36.148.17
. 3600000 ns j.Root-servers.net.
J. ROOT-SERVERS.NET. 3600000 A 198.41.0.10
. 3600000 ns k.root-servers.net.
K.Root-Servers.Net. 3600000 A 193.0.14.129
. 3600000 ns l.Root-servers.net.
L. ROOT-SERVERS.NET. 3600000 A 198.32.64.12
. 3600000 ns m.Root-servers.net.
M.Root-Servers.Net. 3600000 A 202.12.27.33
6. / etc / hosts
Role: Implement the mapping of other major computers on the Internet, which is usually as a backup of DNS, that is, the Hosts table is used when there is a problem in the DNS system.
Example:
127.0.0.1 Localhost Localhost.localdomain Localhost
192.168.10.1 THJ.MYCompany.com THJ
# Since each server has several domain names and IP correspondences are permanent, they should be stored in the HOSTS table.
7. /etc/resolv.conf
Role: Specify the IP and search order of the domain name server.
Example:
Domain
# Define the local domain name.
Search mycompany.com
# Simplify the host name entered by the user, that is, when the user enters THJ, make DNS can put it
Successfully resolved as THJ.MYCOMPANY.COM. It is mutually exclusive with Domain, no matter who
It is now used to define the Search list.
Nameserver 192.168.10.1
# Define the IP of the domain name server, up to three, it is recommended to use two.
8. /etc/hosts.conf
Role: How to implement the relationship between the HOSTS table and DNS.
Example: Order Hosts, Bind
# Analyze the order of the domain name
Multi on
# Allow a computer to have multiple IPs
9. /etc/nsswitch.conf
Role: Used to process the order of HOSTS tables and DNS
Example:
Passwd: Files Nisplus NIS
Shadow: FILES NISPLUS NIS
Group: FILES NISPLUS NIS
HOSTS: Files DNS
Bootparams: Nisplus [notfound = return] Files
Ethers: files
Netmasks: files
Networks: Files
Protocols: files
RPC: FILES
Services: Files
NetGroup: NISPLUS
Publickey: NISPLUS
Automount: FILES NISPLUS
Aliases: files nisplus
1.4 Test and Management Method 1. Administrator modifies the DNS profile, you need to execute /etc/rc.d/init.d/named restart to be changed.
2. NDC Tool: Used to send a signal to the NAMED process
3. NSLOOKUP: Test is correct, reverse resolution is normal
1.5 This chapter is the basis of many services, so configuring a Linux Server should start from DNS, and to configure what is the whole grasp from the beginning, so that the configuration can be mutually Coordinate and avoid errors.