Linux hosts fail to access network through domain name

Source: Internet
Author: User

Failure Phenomena :

    1. Use Telnet ip+ port to test normal, can access;
    2. via Telnet domain + port mode, hint: unknown name or service (name or services not known).
    3. Test Baidu's network address, Ping can pass. But ping the domain name, the same hint appears.

According to the above fault phenomenon analysis, the preliminary judgment is the DNS configuration problem.

Troubleshooting process:

By nslookup testing DNS resolution, the local DNS server configuration should be available from the results.

However, the test found that the use of Telnet domain name + port to test the way, still prompt: unknown name or service .

Other machines with the same network segment have been tested, and the configured DNS server x.x.x.x can be parsed properly, so it is still suspected to be a native configuration problem.

Search for relevant information. Found in the Linux system has a configuration file/etc/nsswitch.conf, which defines the domain name resolution of the search order.

In general, the resolution of the domain name is done in two ways. One is static parsing, configured through the/etc/hosts file, and the other is through a DNS server.

Check the/etc/nsswitch.conf, and find that the configuration of the corresponding item is as follows, DNS is commented out, so the host will never use the DNS configuration to resolve the address.

Modify the configuration, remove the comments later, re-test, by the way the domain name Telnet, can pass. Troubleshooting.

Linux hosts fail to access network through domain name

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.