Change the DNS parsing Order of Linux (DNS to hosts)

Source: Internet
Author: User

In Linux, often parsing a domain name, the first will find /etc/hosts file, if the /etc/hosts file does not correspond, will go to find DNS, then what is the way to let the host first look for DNS it?

Of course, it's defined in the /etc/nsswitch.conf file.

/etc/nsswitch.conf

Hosts:files DNS//Find this section and change it to the following

Hosts:dns files

In this way, your host will go to the DNSFirst, and then go to the hosts

Note: The file content is not necessarily so simple, but the principle is similar.

Reference:

http://blog.51cto.com/hxl2009/632079 (the above content is transferred from this article)

Http://blog.sina.com.cn/s/blog_6965d96d0102uyv8.html

Change the DNS parsing Order of Linux (DNS to hosts)

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.