Solve CentOS domain name resolution configuration problems

Source: Internet
Author: User

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.

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.