Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to clear DNS cache under Linux

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to clear the DNS cache under Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Sometimes the computer suddenly can not access the Internet, or there are some websites can not be opened, but other sites can be opened, the solution needs to clear the DNS cache.

There are usually two ways to implement DNS cache under Linux: one is to use DNS cache program NSCD (name service cache daemon) to manage DNS cache. One way to implement DNS cache is to use Bind to set up Caching Name Server.

If you are clearing Cache on NSCD, restart the NSCD service to achieve the effect of clearing DNS Cache. Use this command: # service nscd restart or # / etc/init.d/nscd restart

If you are clearing CACHE on the BIND server, use this command: # rndc flush

If your DNS server is implemented in dnsmasq, use the following command: $sudo / etc/init.d/dnsmasq restart

Note: DNSmasq is a lightweight and easy-to-use DNS service tool that can be applied to NAT translation of IP addresses when intranets and Internet connections are connected, and can also be used as DNS services for small networks.

2, other operating systems to clear DNS cache methods 1, Microsoft windows how to clear dns: you can use the following command to clear dns cache content. Ipconfig / flushdns

You can also view the contents of the dns cache with the following command. The DNS Cache under ipconfig/displaydnswindows is controlled by the DNS Client background process. You can turn it off in the Control Panel-> service, so that windows will not do DNS caching and will query DNS Server directly each time.

2. How to clear the DNS cache in Mac OSX: in Mac OSX, you can clear the contents of the DNS cache with the following command: bash-2.05a$lookupd-flushcache

Third, some other DNS Cache tips Q: how to view BIND DNS Server Cache: a: in bind 9, you can use the rndc-dumpdb command to view DNS Cache, of course, your rndc should be configured first. This command generates the named_dump.db file in the / var/named directory (this directory is specified in the named.conf file). Under bind8, you can try using kill-INT named_pid.

Q: how to set the DNS Cache time: a: in bind9, use the TTL parameter to set the DNS default cache time, but keep in mind that this is the cache time of the domain name you resolved in someone else's DNS.

Q: how to clear DNS Cache:An on the client: under Unix, the DNS client is only a few routines that are responsible for forwarding and receiving queries and are not cached.

Q: how to empty DNS Cache:An on the DNS server side: the easiest way is to restart the named process; of course, there is also a way not to restart: rndc flush

This is the end of the article on "how to clear the DNS cache under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report