Solve CentOS domain name resolution configuration problems
Solved two problems:
1. domain name resolution: the ip address can be accessed, but the domain name cannot be accessed.
2. After the network is configured, switch to the command line mode and the configured network will no longer be available.
Specific Method:
Open vim/etc/sysconfig/network-scripts/ifcfg-Wired_connection_1
(Ubuntu is located at/etc/NetworkManager/system-connections)
TYPE = Ethernet
BOOTPROTO = none
IPADDR = 192.168.205.7 // vm ip Address
PREFIX = 24
GATEWAY = 192.168.205.2 // network virtual machine, you know this
DNS1 = 10.103.10.1 // according to the actual settings, only DNS1 does not have DNS2
DEFROUTE = yes
20174_failure_fatal = yes
IPV6INIT = no
NAME = "Wired connection 1"
UUID = 7b535c60-6c89-407a-82b6-8a9bc3218d33
ONBOOT = yes
Restart the network.
Service network restart
Summary: If the DNS information is not configured in the NIC configuration file (/etc/sysconfig/network-scripts/file name), only in/etc/resolv. the configuration in conf is invalid.