In practice, the domain name system file configuration of solaris-Linux Enterprise Application-Linux server application information. The following is a detailed description. I. Summary
Configuration of domain name system files for solaris, including/etc/nsswitch. conf, resolv. conf, and hosts
Enables the server to access (ping) the domain name.
Ii. Text
# Ping www.163.com
No answer from www.163.com
1. Configure the nsswitch. conf file, mainly the hosts item, as shown below:
# Vi/etc/nsswitch. conf
#
#/Etc/nsswitch. files:
#
# An example file that cocould be copied over to/etc/nsswitch. conf; it
# Does not use any naming service.
#
# "Hosts:" and "services:" in this file are used only if
#/Etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
/* Here the configuration instructions should first use files and then use dns. For the files configuration, see/etc/hosts. For the dns configuration, see/etc/resolv. conf */
2. Configure the hosts file
Configure local domain name resolution for hosts.
3. Configure the resolv. conf file
/Etc/resolv. conf configure the remote domain name resolution server. The following 202.96.64.68 is the Domain Name Server.
# Vi/etc/resolv. conf
Nameserver 202.96.64.68
When the loghost is pinged, the system first searches for it in/etc/hosts, because nsswitch. the hosts entry in the conf file is configured and the corresponding address 218.25.254.24 is found. When you ping www.163.com, the system accesses resolv because the local hosts does not find a match. the Domain Name Server Resolution configured in conf.
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