For more information about how to manage and maintain DNS servers in UNIX, see Linux Enterprise applications-Linux server applications. 1. DNS management and maintenance for UNIX systems
1. Start and Stop DNS
For example, how to start and stop DNS in the Solaris System:
Log on to the system as root
# Ps? Ef | grep named view the named process ID pid
1) Restart named:
# Kill? HUP pid
2) Stop named:
# Kill pid
For example, how to start and stop DNS in the AIX system:
Log on to the system as root
1) Start named:
# Startsrc? S named
2) Stop named:
# Stopsrc? S named
3) modify the database and re-read the database:
# Refresh? S named
2. Enable the DNS service to automatically start with the UNIX System
When we create and configure a DNS server, when the UNIX system restarts, the DNS service is generally not automatically started and must be started manually, which is very troublesome. In the Solaris system, we must modify the inetd. conf configuration file, find the named comment line, and remove the preceding.
In the AIX system, to enable the named to work at the next startup, you should open the notes on named in the/etc/rc. tcpip file (# smit stnamed ).
Ii. unix dns testing and debugging tools
After installing and setting the DNS, the client can ask the server for name resolution. You can use related tools to test and debug the DNS server. Named provides several built-in auxiliary debugging tools, the most important of which is the log function with flexible configurability. You can specify the debugging level on the command line or set them with ndc, you can also run the named command to dump the running statistical results to a file and use dig or nslookup to verify domain name query.
1. First, we use the system command ping to test whether it can work together.
# Ping "Domain Name"
In UNIX systems, if the problem persists, first check whether the DNS Service is working. Then, run the unix ps command to check whether the named process exists, such as ps? Ef | group named; if the process already exists, check whether all the configuration files in the DNS creation process are correct.
In a Windows client, you can enter the MSDOS mode. For example, run the ping hostname command at the prompt of C \>. hostname indicates the full name of the domain name to be queried, if the configuration is correct, the resolved IP address is immediately displayed. Otherwise, if the result is not displayed for a long time, it indicates that the configuration is incorrect and you need to find the cause.
2. view the Log System
The flexibility of the named log tool is good. BIND4 uses system logs to report error messages and abnormal situations. BIND8 adds another indirect layer and supports directly recording logs into files, the concept of system logs is promoted. BIND logs are configured using the logging statement in named. conf. The default log configuration of BIND8 is:
Logging {
Category default {default_syslog; default_debug ;};
Category panic {default_syslog; default_stderr ;};
Category eventlib {default_debug ;};
Category packet {default_debug ;};
};
Default_syslog: use the tool daemon to send messages of higher severity and info to syslog;
Default_debug: logs are logged to the file named. run, And the severity is set to dynamic;
Default_stderr: Standard Error output for sending messages to named. The severity is info.
When a DNS running error occurs, you can view the system log file syslog and named. run, and find the solution against the list of BIND error messages (which can be downloaded at http://www.acmeb?com/askmrdns/bind-messaged.htm.
3. debugging level
The named debugging level is represented by an integer from 0 to 11. The larger the number, the more detailed the output information. Levels 0 disable debugging. levels 1 and 2 are applicable to debugging configurations and databases. levels greater than 4 are applicable to code maintenance personnel. We can use the-d mark in the named command line to call debugging, for example:
# Named? D2
The named will be started at debug level 2 and the debugging information will be written to the named. run file. The location of the file varies with the UNIX system. The higher the severity level, the more information the log records.
4. ndc debugging
The ndc command (rndc in BIND 9) is a good tool for operating named. The command for generating files puts the files in the directory specified as the named main directory in named. conf.
Some common ndc Debugging commands are described as follows:
Status: displays the current status of the running named;
Dumpdb: dump the DNS database to named_dump.db;
Stats: Dump statistics to named. stats;
Reload: reload named. conf and zone files;
Restart: restart named to clear the cache;
Notrace: Disable debugging.
For example, the latest version of named retains the query statistics. We can use ndc stats to access it. When named receives this command, it writes statistics to the file named. stats.
5. Use nslookup, dig, and host for debugging.
In shell mode, you can use three tools to query DNS databases: nslookup, dig, and host. The software release of BIND includes nslookup and dig. Nslookup is the oldest of the three tools and is always released along with BIND. dig is a domain information Exploration Program, which was originally compiled by Steve Hotz, later, Michael Sawy re-compiled BIND 9 and released it together with BIND. host was written by Eric Wassenaar and is another open-source tool with friendly output, the function is to check the syntax of the zone file.
In addition, the three use different parser libraries: dig and host use the BIND parser, while nslookup has its own parser.
(1) nslookup
After entering the nslookup command, you will see the> prompt symbol. Then you can enter the query command. Generally, IP address or domain name is entered for reverse and forward resolution. Nslookup not only provides the above two types of resolution, but also provides other data record types in DNS, such as MX, NS... Wait. We can directly input "?" In the prompt symbol "?" To obtain all available parameters or data types.
# Nslookup
Default Server: ghq.js.com
Address: 61.155.107.131
>
(2) dig
Usage: dig [@ server] [-B address] [-c class]… (For details, refer to "man dig)
# Dig ghq.js.com
The domain name query packet is sent to the name server. The following parameters can be connected to IP address or domain name to obtain information provided by the name server. Similar to nslookup, dig also provides different data record types, for example, MX... And so on.
(3) host
The host is basically a dns query, followed by an IP address or domain name to obtain the corresponding domain name or IP address.
# Host ghq.js.com
Ghq.js.com has address 61.155.107.131
Iii. Routine DNS Security Management and Maintenance
In view of the security configuration of the bind dns service software, we need to make full use of the protection functions implemented by BIND itself to enhance the BIND Security so as to resist the currently known BIND security vulnerabilities, and minimize the impact of potential security vulnerabilities on servers. This is also an important task for daily management and maintenance of unix dns.
The following methods can be used to manage the secure operation of DNS servers:
1. Multiple Domain name servers are used to cope with malicious attackers and DoS attacks on the DNS server.
In theory, a DNS server can complete all tasks. After registering a domain name, you can set up to six DNS server names for the Enterprise Domain Name. If the Primary Domain Name Server is attacked, you can enable the secondary Domain Name Server. If both the primary and secondary domain name servers are attacked at the same time, you can also use the third or fourth Domain Name Server for work, you can set several domain name servers based on the enterprise's network conditions.
For a large number of users, when such multiple DNS servers stop the service, the only impact is that the query of domain names will be delayed because it needs to be queried one by one, until the last one is found.
2. enable BIND (DNS) Security Options for configuration.
The named process startup options are as follows:
-R: Disable the recursive query function of the Domain Name Server (enabled by default ). This option can be configured.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service