Одно из частых действий, необходимых при решении проблем с работой Интернета (таких как ошибка ERR_NAME_NOT_RESOLVED и других) или при смене адресов DNS серверов в Windows 10, 8 или Windows 7 — очистка кэша DNS (кэш DNS содержит соответствия между адресами сайтов в «человеческом формате» и их фактическим IP-адресом в интернете).
В этой инструкции подробно о том, как очистить (сбросить) кэш DNS в Windows, а также некоторые дополнительные сведения по очистке данных DNS, которые могут оказаться полезными.
Очистка (сброс) кэша DNS в командной строке
Стандартный и очень простой способ сброса кэша DNS в Windows — использовать соответствующие команды в командной строке.
Шаги, чтобы очистить кэш DNS при этом будут следующими.
- Запустите командную строку от имени администратора (в Windows 10 для этого можно начать набирать «Командная строка» в поиске на панели задач, затем нажать правой кнопкой мыши по найденному результату и выбрать «Запуск от имени администратора» в контекстном меню (см. Как запустить командную строку от имени администратора в Windows).
- Введите простую команду ipconfig /flushdns и нажмите Enter.
- Если всё прошло успешно, в результате вы увидите сообщение о том, что «Кэш сопоставителя DNS успешно очищен».
- В Windows 7 дополнительно можно выполнить перезапуск службы DNS-клиент, для этого там же в командной строке по порядку выполните следующие команды
- net stop dnscache
- net start dnscache
После выполнения описанных действий сброс кэша DNS Windows будет завершена, однако в некоторых случаях могут возникнуть проблемы, вызванные тем, что и у браузеров есть собственная база данных соответствий адресов, которую также можно очистить.
Очистка внутреннего кэша DNS Google Chrome, Яндекс Браузера, Opera
В браузерах на базе Chromium — Google Chrome, Opera, Яндекс Браузер присутствует собственный кэш DNS, который также можно очистить.
Для этого в браузере введите в адресную строку:
- chrome://net-internals/#dns — для Google Chrome
- browser://net-internals/#dns — для Яндекс Браузера
- opera://net-internals/#dns — для Оперы
На открывшейся странице вы можете посмотреть содержимое кэша DNS браузера и очистить его, нажав кнопку «Clear host cache».
Дополнительно (при проблемах с соединениями в конкретном браузере) может помочь очистка сокетов в разделе Sockets (кнопка Flush socket pools).
Также, оба этих действия — сброс кэша DNS и очистку сокетов можно быстро выполнить, открыв меню действий в правом верхнем углу страницы, как на скриншоте ниже.
Дополнительная информация
Существуют и дополнительные способы сброса кэша DNS в Windows, например,
- В Windows 10 присутствует опция автоматического сброса всех параметров подключений, см. Как сбросить настройки сети и Интернета в Windows 10.
- Многие программы для исправления ошибок Windows имеют встроенные функции для очистки кэша DNS, одна из таких программ, направленная именно на решение проблем с сетевыми подключениями — NetAdapter Repair All In One (в программе присутствует отдельная кнопка Flush DNS Cache для сброса кэша DNS).
Если простая очистка не срабатывает в вашем случае, при этом вы уверены, что сайт, к которому вы пробуете получить доступ работает, попробуйте описать ситуацию в комментариях, возможно, у меня получится вам помочь.
You’ve probably noticed that, after visiting a website for the first time, the website loads much quicker the next time you visit.
This is because your operating system, or browser in the case of Google Chrome, cache IP addresses and DNS (Domain Name System) information of any website you visit. The DNS cache contains:
- the website address or hostname, technically called the resource data (rdata)
- the domain name of the website
- record type (IPv4 or IPv6)
- the validity of the cache or TTL (time to live)
When the TTL expires, the cache will be cleared, and the DNS is flushed for you automatically. But there are times when you don’t want to wait hours or days for the TTL to expire, and want to flush your DNS manually.
In this article, I’ll go over why you should flush your DNS, and how to do that in Windows 10 and Chrome.
So, Why Should You Flush (or Clear) Your DNS?
Flushing your DNS has several advantages, such as:
- hiding your search behavior from data collectors who might show you ads based on your search history
- requesting that an updated version of a website or web app is loaded. This can help resolve 404 issues if a website or web app was migrated to a new domain
- preventing DNS cache poisoning – a security situation in which black hat hackers gain maliciously gain access to your DNS cache and alter them so you get redirected to a website where sensitive information might be collected from you
To flush your DNS records on Windows 10, follow the steps below:
Step 1: Click on Start or hit the Windows [logo]
key on your keyboard
Step 2: Type «cmd», then select «Run as Administrator» on the right
Step 3: Type in «ipconfig /flushdns» and hit ENTER
You should get a response that the DNS cache has been flushed like the one below:
This means that your cache has been completely cleared, and fresh versions of any website you visit will be loaded.
How to Clear the DNS Cache on Google Chrome
Despite not being an operating system, Chrome keeps a DNS cache of its own to help personalize your browsing experience.
To flush Chrome’s DNS, all you need to do is type chrome://net-internals/#dns
in the address bar and hit ENTER
.
Then click “Clear host cache”:
Conclusion
As you’ve learned in this article, flushing your DNS gives you a lot of advantages that can make your internet experience safer.
Even though the cache gets cleared after the TTL expires, you should flush your DNS as often as possible so you can get these advantages.
Thank you for reading!
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
-
Главная
-
Статьи хостинга 1BX.host
-
Общие статьи
Полная очистка DNS Windows 10 (ipconfig /flushdns)
Пара простых действий для очистки всего cache DNS на Вашем компьютере
Быстрый ответ
- Запустите командную строку от имени администратора
- Введите команду
ipconfig /flushdns
и нажмите Enter.
Подробный текст
Чтобы очистить кэш DNS необходимо выполнить следующие действия:
- Запустите командную строку от имени администратора (ПУСК -> набираете на клавиатуре «cmd» -> клик правой клавишей мыши -> запуск от имени Администратора)
- Введите простую команду
ipconfig /flushdns
и нажмите Enter. - Если всё прошло успешно, в результате вы увидите сообщение о том, что «Кэш сопоставителя DNS успешно очищен»
Помимо этого иногда бывает необходимо чтобы браузеры сбросили свой внутренний кэш DNS (да, так тоже бывает). Далее по списку:
В вашем браузере введите в адресную строку:
- для Google Chrome
chrome://net-internals/#dns
- для Яндекс Браузера
browser://net-internals/#dns
- для Opera
opera://net-internals/#dns
На открывшейся странице вы можете посмотреть содержимое кэша DNS браузера и очистить его, нажав кнопку «Clear host cache».
Прекарсно, кэш сброшен. Приятной работы!
Flushing the DNS cache using the command line can help resolve network issues by clearing outdated or incorrect DNS information stored on your computer.
Here’s the command to flush the DNS cache:
ipconfig /flushdns
Understanding DNS and Caching
What is DNS?
The Domain Name System (DNS) is a fundamental component of the internet, acting as a directory for translating human-friendly domain names (like www.example.com) into machine-readable IP addresses (like 192.0.2.1). This process is crucial because while we tend to remember names, computers communicate using numeric addresses.
What is DNS Caching?
DNS caching is the temporary storage of DNS query results. When you visit a website, your operating system or router caches the IP address returned by the DNS server to speed up subsequent requests for that same domain. This is especially beneficial for frequently visited sites, reducing load times and network traffic.
When Should You Flush Your DNS Cache?
Flushing the DNS cache may be necessary in several scenarios:
- Connection Issues: Problems connecting to websites or sluggish browsing can sometimes be remedied by clearing outdated or corrupt cache entries.
- DNS Record Changes: If the DNS records for a website have changed (like when a site moves to a new server), your local cache may still be pointing to the old IP address.
- Website Loading Issues: If a website isn’t loading correctly or displays outdated content, a DNS flush can help resolve these problems.
Virus Scan Cmd: Quick Guide to Protect Your PC
How to Flush DNS Cache Using CMD
Preparing to Use CMD
Before you can flush your DNS cache, you’ll need to access the Command Prompt (CMD). Here are the steps for different versions of Windows:
-
Windows 10
- Press `Windows Key + X` and choose Command Prompt (Admin).
-
Windows 8/8.1
- Press `Windows Key + X`, select Command Prompt (Admin).
-
Windows 7
- Click on the Start menu, search for cmd, right-click on it, and select Run as administrator.
The DNS Flush CMD Command
The command you need to execute to clear your DNS cache is simple and straightforward:
ipconfig /flushdns
This command instructs Windows to delete the current DNS cache and start afresh.
Step-by-Step Guide to Execute the Command
Opening Command Prompt
To ensure that the command executes successfully, open CMD with administrative privileges. This will allow you to make system-level changes, including flushing the DNS cache.
Executing the Flush DNS Command
Once you have CMD open, type the following command and then press Enter:
ipconfig /flushdns
After a moment, you should see a confirmation message indicating that the operation was successful:
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
This message reassures you that your DNS cache has been cleared.
How to Flush DNS in Cmd: A Quick Guide
Verifying the DNS Cache Flush
How to Check if DNS Cache Was Flushed
After flushing, you may want to verify that the DNS cache has been cleared. You can use the following command:
ipconfig /displaydns
Understanding the Output
When you run this command, it will display the current DNS entries stored in your cache. If the flush was successful, this list should be empty or significantly reduced.
Mastering Pushd Cmd: Navigate Directories Like a Pro
Troubleshooting Common Issues
If the DNS Flush Command Doesn’t Work
If you encounter problems executing the DNS flush command, there are several reasons this might occur:
- Permissions Issues: Ensure that you are running CMD as an administrator.
- CMD Not Running as Administrator: Always verify that you have the proper access levels.
- Network Connection Problems: Check that your internet connection is active and functioning correctly.
Alternative Commands Related to DNS Management
In addition to flushing the DNS cache, there are other useful commands you might want to familiarize yourself with:
-
Release IP Configuration: This command releases the IP address from the network interface.
ipconfig /release
-
Renew IP Configuration: After releasing, you can renew the IP address to re-establish connection with the network.
ipconfig /renew
Mastering Saltstack Cmd.Run for Efficient Task Automation
Additional Tips for Managing DNS Cache
Set a Regular Schedule for DNS Cache Flushing
Regular DNS cache flushing is a good practice, especially for heavy internet users. Consider flushing your DNS cache periodically, such as once a week or whenever you experience connectivity issues. This helps maintain optimal browsing performance.
Using Other Tools for DNS Management
While CMD is an efficient tool for flushing and managing your DNS cache, there are graphical tools and network management software available that can simplify the process for less tech-savvy users. These tools often provide user-friendly interfaces to manage your DNS settings effectively.
Uninstall Cmd: A Simple Guide to Command Line Removal
Conclusion
Flushing the DNS cache is an essential skill for troubleshooting connectivity issues and ensuring smooth web browsing. Using the CMD method, you can quickly and effectively manage your DNS settings, boosting your expertise in network troubleshooting.
Don’t hesitate to practice the flush dns cache cmd command and explore other DNS management options in CMD. Your ability to resolve internet issues will greatly improve as you incorporate these practices into your digital toolkit.
Reverse DNS Cmd: A Quick Guide to Lookup Commands
FAQ Section
What is the Purpose of Flushing the DNS Cache?
The primary purpose of flushing the DNS cache is to remove outdated or incorrect DNS entries that may interfere with your ability to access websites correctly. This can enhance your browsing experience and resolve connectivity issues.
Can I Use DNS Flush CMD on Other Operating Systems?
The `ipconfig /flushdns` command is specific to Windows. Users on macOS can use the `sudo killall -HUP mDNSResponder` command in the Terminal, while Linux users may use `sudo systemd-resolve —flush-caches` or similar commands depending on the distribution.
How Often Should I Flush My DNS Cache?
While there are no hard and fast rules, flushing your DNS cache might be beneficial whenever you encounter connectivity problems, after you’ve made significant network changes, or even on a regular schedule for regular maintenance.
The Windows operating system holds onto a cache of DNS data called DNS resolver cache, so it does not have to reach out to the DNS server for every single name resolution request.
One can check the current DNS cache using the following CMD command:
ipconfig /displaydns
If you experience problems with name resolution on your Windows 10 PC, you can flush the DNS cache with the following command:
ipconfig /flushdns
The flushdns
command removes locally cached copies of the DNS resolver and forces Windows to request a new record from the DNS server.
Using PowerShell
On a PowerShell prompt, you can display and flush DNS with Get-DnsClientCache
and Clear-DnsClientCache
commands, respectively.
Check the DNS client cache:
Get-DnsClientCache
Flush the DNS client cache:
Clear-DnsClientCache
The Get-DnsClientCache
command is run in the following screenshot, and it shows the DNS cache on a Windows 10/11 computer.
Troubleshooting Name Resolution
A powerful tool for troubleshooting name resolution on Windows is nslookup
which allows us to perform manual DNS queries from the command prompt.
The following screenshot shows a simple example of the use of nslookup
.
The first two lines show the name and IP address of the DNS server that has responded. The answer section contains the actual response to the lookup, which is IPv4 and IPv6 addresses for the domain name.
Resolve-DnsName
is the PowerShell equivalent to the nslookup
command.
The Resolve-DnsName
command is run in the above screenshot. It shows the IPv4 (A record) and IPv6 (AAAA record) addresses of the domain name.