Одно из частых действий, необходимых при решении проблем с работой Интернета (таких как ошибка 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).
Если простая очистка не срабатывает в вашем случае, при этом вы уверены, что сайт, к которому вы пробуете получить доступ работает, попробуйте описать ситуацию в комментариях, возможно, у меня получится вам помочь.
Are you facing issues while surfing the internet? Does the website you are trying to reach doesn’t open? If you’re unable to access the website then the reason behind this issue might be because of the DNS server and its resolving cache.
DNS or Domain Name System is your best friend while you are online. It converts the domain name of the website you visited into IP addresses so that the machine can understand it. Suppose you visited a website, and you used its domain name for doing this. The browser will redirect you to a DNS server and it will store the IP address of the website you are visiting. Locally, inside your device, there is a record of all the IP addresses, meaning the websites you have visited. Whenever you try to re-access the website again, it will help you gather all the information faster than before.
All the IP addresses are present in the form of a cache in DNS Resolver Cache. Sometimes, when you try to access the site, instead of getting faster results, you get no result at all. Therefore, you need to flush the reset DNS resolver cache for getting the positive output. There are some common reasons which cause the DNS cache to fail over time. The website may have changed their IP address and since your records have the old records. And hence, you may have the old IP address, causing problems while you are trying to establish a connection.
Another reason is the storing of bad results in the form of a cache. Sometimes these results get saved due to DNS spoofing and poisoning, ending up in unstable online connections. Maybe the site is fine, and the problem is in the DNS cache on your device. The DNS cache can get corrupt or outdated and you may not be able to access the site. If any of this has happened, then you may need to flush and reset your DNS resolve cache for better results.
Just like DNS resolver cache, there are two other caches present on your device, which you can flush and reset if needed. These are the Memory cache and the Thumbnail cache. Memory cache comprises a cache of data from your system memory. Thumbnail cache contains the thumbnails of the images and videos on your device, it includes the thumbnails of deleted ones also. Clearing the memory cache frees some system memory. While clearing the thumbnail cache can create some free room on your hard disks.
Table of Contents
There are three methods applicable for flushing your DNS resolver cache in Windows 10. These methods will fix your internet problems and help you with a stable and working connection.
Method 1: Use the Run Dialog Box
1. Open the Run dialog box using the shortcut key Windows Key + R.
2. Type ipconfig /flushdns in the box and hit the OK button or the Enter box.
3. A cmd box will appear on the screen for a moment and will confirm that the DNS cache will get successfully cleared.
Method 2: Using Command Prompt
If you don’t use an administrative account to login to the Windows, then make sure you have access to one or you create a new administrative account as you will require admin rights to clear the DNS cache. Else, the command line will show System 5 error and your request will get denied.
Using Command Prompt you can perform various other functions related to DNS cache and your IP address. These include viewing the current DNS cache, registering your DNS cache on host files, releasing the current IP address settings and also requesting & resetting the IP address. You can also enable or disable DNS cache with only one line of code.
1. Type cmd in Windows Search bar then click on “Run as administrator” to open the elevated Command Prompt. Remember to run the command line as an administrator for making these commands work.
2. Once the command screen appears, enter the command ipconfig /flushdns and hit the Enter key. Once you hit Enter, you will see a confirmation window appear, confirming the successful DNS cache flushing.
3. Once done, verify if the DNS cache is cleared or not. Enter the command ipconfig /displaydns and hit the Enter key. If there are any DNS entries left, they will get displayed on the screen. Also, you can use this command anytime to check the DNS entries.
4. If you want to turn off the DNS cache, type in the command net stop dns cache in the command line and press the Enter key.
5. Next, if you want to turn on the DNS cache, type the command net start dnscache in the Command Prompt and press the Enter key.
Note: If you turn off the DNS cache and forget to turn it on again, then it will automatically start after you restart your system.
You can use ipconfig /registerdns for registering the DNS cache present on your Hosts file. Another one is ipconfig /renew which will reset and request a new IP address. For releasing the current IP address settings, use ipconfig /release.
Method 3: Using Windows Powershell
Windows Powershell is the most powerful command line present on the Windows OS. You can do much more with PowerShell than you can do with the Command Prompt. Another advantage of Windows Powershell is you can clear client-side DNS cache while you could only clear local DNS cache in Command Prompt.
1. Open Windows Powershell using the Run dialog box or the Windows search bar.
2. If you want to clear the client-side cache, enter the command Clear-DnsClientCache in Powershell and hit the Enter button.
3. If you want to clear just the DNS cache on your desktop, enter Clear-DnsServerCache and hit the Enter key.
What if the DNS Cache is not getting cleared or flushed?
Sometimes, you may not be able to clear or reset DNS Cache using the Command Prompt, it may happen because the DNS cache is disabled. So, you need to first enable it before clearing the cache again.
1. Open the Run dialog box and enter services.msc and hit Enter.
2. Search for DNS Client Service in the list and right-click on it and select Properties.
4. In the Properties window, switch to the General tab.
5. Set the Startup type option to Automatic, and then click on OK to confirm the changes.
Now, try to clear the DNS cache and you will see that the command is running successfully. Similarly, if you want to disable the DNS cache for some reason, change the startup type to Disable.
Recommended:
- Quickly Clear All Cache in Windows 10 [The Ultimate Guide]
- 10 Best Public DNS Servers in 2021: Comparison & Review
- 3 Ways to change DNS settings on Windows 10
We hope this article was helpful and you were able to flush & reset the DNS cache in Windows 10. If you still have any questions then feel free to ask them in the comment section.
Кэш DNS может быть поврежден по ряду причин, включая сетевые атаки или вирусы. Когда это происходит, сопоставление IP-адресов становится поврежденным для некоторых популярных веб-сайтов.
Например, вместо того, чтобы заходить на сайт www.google.com, ваш браузер может перенаправить вас на IP-адрес вредоносного веб-сайта, который злоумышленник вставил в записи DNS вашего компьютера. Или вы можете получить большое количество ошибок 404.
Очистка кеша DNS удаляет всю сохраненную информацию поиска DNS. Затем ваш компьютер получает обновленные данные с DNS-серверов при следующей отправке запроса на поиск.
Как очистить кэш DNS в Windows
Очистка кеша DNS — это простой и быстрый процесс. Процедура одинакова для почти всех систем Windows. Для примера ниже мы будем использовать Windows 10.
Чтобы очистить DNS на вашем компьютере с Windows:
- Загрузите командную строку от имени администратора. Откройте меню «Пуск» и начните вводить «командная строка» или «cmd», пока не увидите ее в результатах.
-
Введите
ipconfig/flushdns
, когда командная строка загрузится, и нажмите Enter на клавиатуре. -
Процесс должен занять всего несколько секунд. Вы должны увидеть подтверждающее сообщение DNS Resolver Cache, когда это будет сделано:
База данных кэша DNS на вашем компьютере теперь очищена. Вы должны получить правильное и обновленное сопоставление IP-адресов с DNS-серверов в следующий раз, когда ваш компьютер отправит DNS-запрос.
Очистить кэш DNS на Mac
Есть несколько разных команд для очистки кеша DNS в OS X и macOS в зависимости от используемой версии.
Поскольку процедура одинакова для всех версий, в этой статье подробно описано, как очистить DNS в macOS Mojave (10.14), а затем перечислены команды для других версий в таблице.
Сброс DNS на MacOS Mojave (версия 10.14)
Чтобы очистить кэш DNS на MacOS Mojave, используйте приложение Terminal:
- Запустите Terminal.app, используя ваш предпочтительный метод. Вы можете запустить приложение из Приложения -> Утилиты или нажать
Ctrl + Space
, чтобы запустить Spotlight и выполнить поиск терминала. - Введите
sudo killall -HUP mDNSResponder
и нажмите Enter на клавиатуре. - Введите пароль администратора для рассматриваемой учетной записи и нажмите Enter.
После окончания процесса не будет никаких оповещений
Команды для очистки DNS-кэша в старых версиях macOS и Mac OS X
В таблице ниже перечислены команды для очистки кэша DNS в большинстве версий MacOS и Mac OS X. Вы можете скопировать и вставить их прямо из таблицы в свой терминал.
Mac OS X или macOS версия | Команда терминала |
---|---|
Mojave (version 10.14) High Sierra (version 10.13) Sierra (version 10.12) Mountain Lion (version 10.8) Lion (version 10.7) |
sudo killall -HUP mDNSResponde |
El Capitan (version 10.11) Mavericks (version 10.9) |
sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder |
Yosemite (version 10.10) | sudo discoveryutil mdnsflushcache sudo discoveryutil udnsflushcaches |
Snow Leopard (version 10.6) Leopard (version 10.5) |
sudo dscacheutil -flushcache |
Tiger (version 10.4) | lookupd -flushcache |
Как очистить кэш DNS в Linux
Дистрибутивы Linux немного отличаются от компьютеров с Windows и Mac. Каждый дистрибутив Linux может использовать свою службу DNS. Некоторые дистрибутивы, такие как Ubuntu, вообще не имеют службы DNS по умолчанию.
Это зависит от того, какая служба используется в вашем дистрибутиве и включена ли она по умолчанию. Некоторые из них — NCSD (Name Service Caching Daemon), dnsmasq и BIND (Berkely Internet Name Domain).
Для каждого дистрибутива вам нужно запустить окно терминала. Нажмите Ctrl + Alt + T
на клавиатуре и используйте соответствующую команду, чтобы очистить кэш DNS для службы, работающей в вашей системе Linux.
Очистить локальный DNS-кэш NCSD
Используйте эту команду для очистки DNS-кэша NCSD на вашем Linux-компьютере:
sudo /etc/init.d/nscd restart
Введите свой пароль, если это необходимо. Процесс останавливается, а затем запускает службу NCSD в течение нескольких секунд.
Очистить локальный DNS-кэш dnsmasq
Используйте эту команду для очистки DNS-кэша dnsmasq на вашем Linux-компьютере:
sudo /etc/init.d/dnsmasq restart
Введите пароль еще раз, если терминал попросит вас. Вы увидите ответ, когда служба останавится и запустится снова.
Очистить локальный DNS-кэш BIND
Если вы используете BIND для службы DNS, есть несколько команд, которые вы можете использовать для очистки его кеша DNS. Вам может потребоваться ввести пароль для завершения процесса.
sudo /etc/init.d/named restart sudo rndc restart sudo rndc exec
Примечание: BIND также позволяет указывать конкретные домены при выполнении сброса DNS. Просто добавьте flushname и имя домена в команду sudo rndc. Например:sudo rndc flushname wiki.merionet.ru
-
Главная
-
Статьи хостинга 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».
Прекарсно, кэш сброшен. Приятной работы!
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