Article Title: how to resolve domain names in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In Linux:
Ping www.baidu.com cannot be pinged, but ping 61.135.169.125 can be successful, indicating that the domain name resolution of this machine is faulty.
View/etc/resolv. conf:
Java code
[Root @ host1 ~] # Cat/etc/resolv. conf
Search localdomain
No configuration is available. A free google DNS server 8.8.8.8 can also be used with other:
Java code
[Root @ host1 ~] # Cat/etc/resolv. conf
Search localdomain
[Color = green] servername 8.8.8.8 [/color]
Restart the network:
Ifdown Nic device name (eth0)
Ifup Nic device name (eth0)
Note:
Ifup and ifdown
The ifup command is used to start a specified inactive Nic device. This command is similar to the ifconfig up command. The Ifdown command is used to stop a specified Active Nic device. This command is similar to the ifconfig down command. The two commands are in the following format:
Ifup Nic device name
Ifdown Nic device name