LINUX basic network parameter DNS

Source: Internet
Author: User
Tags nameserver
LINUX basic network parameter DNS-Linux Enterprise Application-Linux server application information. For details, refer to the following section. DNS (Domain Name System), that is, the Domain Name System. In a TCP/IP network (such as the internet) environment, the main function of DNS is to convert a domain name into an IP address that can be identified by the network, it is a server that people can easily remember to put into a domain name to access the network. In Linux, there are two files used to declare where the system looks for a database for name resolution. The/etc/host. conf file is used by the libc library of version 5, while/etc/nsswitch. conf file is used by version 6 (glibc ). The problem is that some programs use one of them, while some use another. Therefore, it is necessary to correctly configure both files.

1./etc/host. conf
The/etc/host. conf file specifies how to resolve the host name. Linux uses the parser library to obtain the IP address corresponding to the host name. The following is the default/etc/host. conf content after RedHat is installed:

[Root @ linpc root] # cat/etc/host. conf
Order hosts, bind

The order parameter specifies the host name query order, which is a comma-separated query method. The multi parameter specifies whether the host specified in the/etc/hosts file can have multiple addresses,

2./etc/nsswitch. conf
/Etc/nsswitch. the conf file is developed by SUN and is used to manage the order of query of multiple configuration files in the system, and/etc/host. it provides more functions than the conf file. /Etc/nsswitch. except for the annotator starting with # In conf, all comments start with a keyword, followed by a colon, followed by a blank space, followed by a list of methods, these methods can provide the system with information related to the keyword that begins with a line, and the system will query in order of their order. Each keyword is the name of the/etc file that can be controlled by/etc/nsswith. conf in the/etc/directory. In the DNS configuration, add the DNS option after the hosts line in the file:

Group: files nis

# Hosts: db files nisplus nis dns
Hosts: files dns

3./etc/resolv. conf
/Etc/resolv. conf is one of the key files used by the network to determine host resolution. A maximum of three domain name servers can be identified here. If the server listed first does not make a response to the query, the latter two serve as backups. The Domain item defines the default Domain name. Nameserver indicates the IP address of the DNS server. Multiple parameters of the Search item indicate the domain name query order. Sortlist allows specific sorting of the obtained domain name results. For example:

[Root @ linpcl root] # cat/etc/resolv. conf
Search lintec.edu.cn
Nameserver 202.106.0.20
Nameserver 202.106.46.151
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.