1. about/etc/host, host name and IP configuration file Hosts-Thestatictablelookupforhostname (host name query static table) Linux/etc/hosts is to configure the IP address and its corresponding host name of the file, you can record a native or other host IP and its corresponding host name.
Different versions of Linux, the configuration file may also be different. Such as Debian's counterpart is/etc/hostname.2. profile this file you can configure the host IP and host name, server type linux system which is not negligible. In the LAN or the Internet, each host has an IP address, it distinguishes each host, and can communicate based on ip. But the IP address is not easy to remember, so have the domain name. In a local area network, each machine has a host name, used to distinguish between host and easy to access. Linux host name of the configuration file is the file/etc/hosts; tell the host which domain name corresponds to the ip, which corresponds to the host name, such as ip: files that define 192.168.1.100linumu100test100 assumptions 192.168.1.100 is a Web server, enter a Web page or http://test100 http://linumu100 opens 192.168.1.100 Web page. Typically this file is first recorded native IP and host name: 127.0.0.1localhost.localdomainlocalost3. configuration file format describes the contents of the General/etc/hosts generally follows similar content: 127.0.0.1localhost.localdomainlocalost192.168.1.100linmu100.comlinmu100192.168.1.120ftpserverftp120 General hosts file of each behavior of a host, each line consists of three parts, each part separated by a space. Which lines beginning with #, do not be system description. First part: the network IP address; the second part: the host name or domain name; part III: host name aliases; of course, each row or two segments, i.e., host IP addresses and host names; for example, there can be a little 192.168.1.100linmu100. explain the host name (hostname) and domain name (Domain): the host name is typically used within a local area network, through the hosts file, the hostname is resolved to the ip; domain names are typically used on the internet, but if this machine does not want to use the Internet's domain name resolution, you can change the hosts file by adding your own domain name resolution. 4./hosts files can help troubleshoot problems 4.1 remote login Linux hosts slow sometimes clients want to remotely log on a linux host, but every time you log on to enter a password will wait for a long time to go into, because linux host in return information needed to resolve ip, if in Linux hosts hosts file prior to client's IP address, and then login from client-side remote linux will change soon. Note: this remote login just ssh, also may be a mysql remote login, file sharing, etc. 4.2 dual machine interconnection when two hosts only when two interconnection, when two hosts will need to set up your own ip, while at the other side of the hosts file to its own IP and host name. 5. host name to modify the tool actually hostname hostname; modifications also has a dedicated tool that displays the ' shostname hostnamehostname-showorsetthesystem hostname: # hostnamelinmu100 this hostname is linmu100 without parameter is used to display the current hostname; temporary setting hostname: # hostnametest100 # hostname Note: display the hostname hostname test100 through tool to set the host name is temporary, the next time you reboot your system, this host name will be does not exist; show host IP: # hostname-i192.168.1.100
No comments:
Post a Comment