03--dns knowledge

Source: Internet
Author: User
Tags domain name server

First, the domain name resolution process

1. The browser checks its own cache, and the cache time varies from a few minutes to an hour, determined by setting the TTL property.

2. If 1 is not found, check the OS cache, such as the host file under Windows, the Linux/etc/hosts file.

3. Query the local domain name server Ldns, which is the DNS server address of the system configuration, usually the SPA (Internet application provider), that is, telecommunications, etc., usually in the corner of your city.

4. If Ldns misses, you want to RDNs (root name server) to send the request.

5. RDNs returns the primary Domain name server (GTLD server) address of the queried domain to Ldns. gTLD is an international top-level domain name server, such as com.cn.org, the world has about 13 units.

6. Ldns a request for a gtld server that is returned up one step.

7. The gTLD server finds and returns the corresponding nameserver address, which is usually your registered domain name server.

For example, if you are applying for a domain name from a domain Name service provider, this parsing task is the responsibility of the domain Name service provider.

8. Name server queries the domain name and IP correspondence, normally returns an IP address with TTL to Ldns.

9. Ldns will cache this result and TTL (set cache time).

10. Return the results to the user, the user operating system according to the TTL value, the record is also cached to the system, the end of the domain name resolution.

Second, tracking the domain name resolution process

Linux under general use dig,windows under general use Nslookup.

Third, clear the domain name cache

1. Under Windows, Ipconfig/flushdns

2. Under Linux,/ETC/INIT.D/NSCD restart

3. In Java, the JVM caches DNS results in the InetAddress class. There are 2 caching mechanisms, one of which is cached correctly and a parse result of cache failure.

Configuration parameters in%java_home%/lib/security/java.security, configuration items are Networkaddress.cache.ttl and Networkaddress.cache.negative.ttl, respectively,

The default values are 1 (never expire) and 10 (cached for 10 seconds), respectively.

Note: When using inetaddress to resolve domain names, be sure to use singleton mode, because each time you create a inetaddress class, you have to do a complete domain name resolution process, affecting efficiency.

Four, commonly used domain name resolution method

03--dns knowledge

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.