Linux hostname of bogon problem Detailed

When using vmware virtual machine installed centos7, often called bogon host of problems

bogon are those that address should appear in the internet routing table of
these addresses should include:
1, such as private addresses 10,172.16-32,192.168 .....
2, has not been formally allocated out of addresses

Check with hostnamectl, the host name is bogon

 

[root@bogon ~]# cat /etc/resolv.conf

 

It found that more than a line search localdomain, should be the cause of this line configuration, resolv.conf configuration vmware 8 card is issued automatically, so change the configuration useless here

Analytical about IP address: View nslookup command from the installation package
[root @ bogon ~] # yum provides * / nslookup

 

[root@bogon ~]# yum -y install bind-utils

This configuration instructions to after loading the configuration file, parses the IP address of the host, the domain returns as the host domain name echoed to the command line, attempt to resolve the local IP

centos 7 下主机名变bogon问题的初探

     IP address of the machine to be resolved in order bogon, then that is a problem, if configured in resolv.conf search localdomain, then the host name is obtained here in preference to hosts and network configuration files

To solve this problem, the simplest solution is to not let it pass when parsing dns, use the hosts file directly to the machine's IP address resolves to your host name to (non localhost)

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.200.132 webserver(your hostname)

Guess you like

Origin www.cnblogs.com/myworld5218/p/11291483.html