CentOS 6.6 Implements a method for permanently modifying a DNS address _ server Other

Source: Internet
Author: User
Tags centos centos server

The example in this article describes the CentOS 6.6 implementation method for permanently modifying DNS addresses. Share to everyone for your reference, specific as follows:

1. Configure IP address file /etc/sysconfig/network-scripts/ifcfg-eth0

Add a line:

Copy Code code as follows:
dns1=8.8.8.8 #手动添加一个dns地址;

The address of the DNS profile/etc/resolv.conf will automatically match the manually added address, and will not be purged after the network card is restarted;

2. Add DNS Address manually

DNS configuration file/etc/resolv.conf

Copy Code code as follows:
NameServer 192.168.1.17

Configure IP Address file/etc/sysconfig/network-scripts/ifcfg-eth0

Add to:

Copy Code code as follows:
Peerdns=no #添加后不会去打扰/etc/resolv.conf File

In a DHCP environment, when/etc/resolv.conf manually add a DNS address, the network adapter is automatically removed, and the DNS address added to/etc/sysconfig/network-scripts/ifcfg-eth0 is not cleared;

Static configuration of IP environment,/etc/resolv.conf Manually add DNS address, reboot will not clear.

I hope this article will help you CentOS server management.

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.