The ping result of the intranet domain name in Linux is inconsistent with the nslookup result

Source: Internet
Author: User
Tags domain name server nslookup

Today, under the Linux server encountered a strange problem: The network domain name ping results and nslookup results inconsistent, the resolution process is recorded as follows.

    1. Confirm that the/etc/resolv.conf configuration is correct: no problem;

    2. Confirm if additional domain name is added in/etc/hosts: no problem;

    3. Confirm the correct IP address in the domain name server, and colleagues confirm that the intranet domain name has been updated, the results of Ping point to the old ip,nslookup the correct results;

    4. Confirm the local domain name cache service NSCD Status: In the run, restart does not solve the problem, it seems that the cache is still very stubborn;

      # Service NSCD Status

      NSCD (PID 30993) is running ...

      # Service NSCD Restart

      stopping NSCD: [OK]

      Starting NSCD: [OK]

    5. Google found NSCD cache file cleanup can be cleaned with the following command, run, the problem is resolved.


# ls/var/db/nscd/

Hosts

# NSCD--invalidate=hosts

# Service NSCD Restart

Please refer to https://stijn.tintel.eu/blog/2012/05/10/how-to-really-flush-the-various-nscd-caches for details.


Summarize:

    1. The Linux server will have a domain name cache locally to speed up domain name resolution, and CentOS uses NSCD

    2. Ping generally uses the cached domain name directly, nslookup directly to the Domain name server query

This article is from the "True Self" blog, so be sure to keep this source http://trueray.blog.51cto.com/5818481/1707575

The ping result of the intranet domain name in Linux is inconsistent with the nslookup result

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.