Set the internal reserved IP address and DNSIP in Linux
Source: Internet
Author: User
In Linux, set the internal reserved IP address and DNSIP-Linux Enterprise Application-Linux server application information. The following is a detailed description. Author: xwg999
/Etc/hosts
Set the name for the internal computer. (The name can be used as needed)
Therefore, write the private IP address and computer name of the computer to/etc/hosts.
Content of this file:
127.0.0.1 localhost. localdomain localhost
Computer IP host name host alias
You can write the IP addresses of all computers in the LAN. Each computer has a name that you like, even if it is different from the computer name set on the client. if DHCP is set, write all IP addresses in a CIDR block to/etc/hosts.
/Etc/resolv. conf
Because the computer will confirm the identity of the other party when interacting with each other, it will also use the/etc/resolv. conf file to query the domain name of the other party.
When a LINUX host queries the identity of the other party, it first queries the setting of the/etc/hosts file, followed by/etc/resolv. conf DNS host. Because the client in the LAN is a private IP address and the private IP address is not written into/etc/hosts, Linux will go to/etc/resolv. the DNS set in conf queries the customer's identity. Because the private IP address is not on the Internet, Linux cannot find it, which generally delays the last 60 seconds.
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