-
Главная
-
Статьи хостинга 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».
Прекарсно, кэш сброшен. Приятной работы!
Одно из частых действий, необходимых при решении проблем с работой Интернета (таких как ошибка 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).
Если простая очистка не срабатывает в вашем случае, при этом вы уверены, что сайт, к которому вы пробуете получить доступ работает, попробуйте описать ситуацию в комментариях, возможно, у меня получится вам помочь.
Эта инструкция применима в ситуациях, когда в браузере появляются ошибки, связанные с DNS, например:
- Эта страница недоступна и код ошибки начинается с DNS_
- Сервер не найден
- Ошибка DNS_PROBE_FINISHED_NXDOMAIN и подобные
Инструкция также может применяться в ситуациях, когда после долгой загрузки сайта браузер сообщает о невозможности подключиться к серверу. Как правило, такое может происходить в ситуации, если IP-адрес сервера сменился, а в DNS-кэше эта запись еще не обновилась.
Windows 10
1. Перейдите на рабочий стол. (Находясь на главном экране, коснитесь или щелкните плитку рабочего стола).
2. Щелкните правой кнопкой мыши кнопку «Пуск» (логотип Windows в нижнем левом углу).
3. Выберите «Windows PowerShell (администратор)». Вместо Windows PowerShell также можно открыть командную строку (для этого нажмите левой кнопкой мыши на кнопку «Пуск», откройте папку «Служебные» — «Windows» и выберите «Командная строка»).
4. В диалоговом окне — «Разрешить этому приложению вносить изменения на вашем устройстве?» — необходимо выбрать «Да».
Примечание
- Если диалоговое окно запрашивает имя пользователя и пароль администратора, вам необходимо связаться с вашим системным администратором.
5. В открывшемся окне последовательно введите команды, подтверждая их нажатием клавиши Enter:
- ipconfig /flushdns
- ipconfig /registerdns
- ipconfig /release
- ipconfig /renew
6. Не закрывая командную строку проверьте работу.
Если действия выше не помогли, в командной строке необходимо ввести команду ниже, подтвердить ее нажатием клавиши Enter и перезагрузить ваш компьютер:
- netsh winsock reset
Windows 7
1. Щелкните левой кнопкой мыши кнопку «Пуск» (логотип Windows в нижнем левом углу) и перейдите в папку «Все программы» > «Стандартные».
2. Щелкните правой кнопкой мыши на программу «Командная строка» и выберите «Запуск от имени администратора».
3. В диалоговом окне «Разрешить ли командной строке вносить изменения в ваш компьютер?» необходимо выбрать «Да».
Примечание
- Если диалоговое окно запрашивает имя пользователя и пароль администратора, вам необходимо связаться с вашим системным администратором.
4. В открытой командной строке последовательно введите команды, подтверждая их нажатием клавиши Enter:
- ipconfig /flushdns
- ipconfig /registerdns
- ipconfig /release
- ipconfig /renew
5. Не закрывая командную строку проверьте работу.
Если действия выше не помогли, в командной строке необходимо ввести команду ниже, подтвердить ее нажатием клавиши Enter и перезагрузить ваш компьютер:
- netsh winsock reset
Mac OS X
1. Закройте все окна браузера.
2. Проверьте версию вашей Mac OS, щелкнув в левом верхнем углу иконку яблока > «Об этом Mac». Запомните версию.
3. Щелкните «Приложения» > «Утилиты» > «Терминал». Или воспользуйтесь поиском.
4. В окне Терминала введите соответствующую команду для вашей версии Mac OS X.
- Для OS X 10.10 (Yosemite) введите команду ниже и нажмите клавишу Enter:
sudo discoveryutil mdnsflushcache
- Для OS X 10.7 — 10.9 (Mavericks, Mountain Lion и Lion) ведите команду ниже и нажмите клавишу Enter:
sudo killall -HUP mDNSResponder
- Для OS X 10.6 и старше ведите команду ниже и нажмите клавишу Enter:
sudo dscacheutil -flushcache
Примечание
- При выполнении команды система может запросить пароль сообщением Password: — в данном случае потребуется ввести пароль вашего пользователя и нажать клавишу Enter.
Если действия выше не помогли
В качестве дополнительной рекомендации можем предложить перезагрузить маршрутизатор.
При наличии системного администратора необходимо предварительно проконсультироваться по данному вопросу с ним.
Для других версий Windows можно воспользоваться инструкциями для Windows 7 или Windows 10, действия и команды аналогичные.
Например, вместо того, чтобы заходить на сайт 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
Table of contents
- What Is the DNS Cache?
- How to Check DNS Cache on Windows 10
- Method 1: Via Command Prompt
- Method 2: Via PowerShell
- Why Clear DNS Cache?
- Is It Safe to Flush the DNS Cache?
- How to Clear DNS Cache
- Method 1: Clear DNS Cache using Command Prompt
- Method 2: Clear DNS Cache using Windows PowerShell
- How to Disable DNS Cache in Windows 10
- How to View DNS Cache on Windows 11?
- Extra Tip: Always Protect Your Privacy
- Conclusion
- FAQ
Do you want to learn how to view DNS cache in Windows 10? If so, this tutorial is for you. On a Windows 10 PC, there are several methods you can use to display the DNS contents. First, here’s a summary of what the DNS cache means.
What Is the DNS Cache?
DNS (Domain Name System) cache, sometimes referred to as DNS Resolver Cache, is a temporary storage of information maintained by your computer.
It contains records of all the recently visited websites and their IP addresses.
It serves as a database that keeps a copy of a DNS lookup locally stored on your browser or operating system. Your computer can quickly refer to it when you load a website.
The DNS cache is like a phonebook that stores an index of all public websites and their IP addresses.
Its main purpose is to speed up a request to load a website by handling name resolution of addresses you recently visited before the request is sent out to many public DNS servers.
Since the information is available locally, the process is much quicker.
How to Check DNS Cache on Windows 10
As noted earlier, various ways exist to display the DNS cache on Windows 10. This can be useful if you want to diagnose DNS issues, for example, where an invalid or out-of-date DNS record might be cached.
Method 1: Via Command Prompt
To display the contents of the DNS cache, you need to execute the following command in an elevated Command Prompt:
- Press the
Windows + S
shortcut keys and type in cmd. - Click on Run as administrator on the right pane.
- On the Command Prompt window, type the following command and press Enter:
ipconfig /displaydns
Upon execution of the command, the following results will be displayed:
- Record Name – This is the name you query the DNS for and the records, such as addresses that belong to that name.
- Record Type – This refers to the type of entry, displayed as a number (although they are commonly referred to by their names). Each DNS protocol has a number.
- Time to Live (TTL) – This value describes how long a cache entry is valid, displayed in seconds.
- Data Length – This describes the length in bytes. For instance, the IPv4 address is four bytes, and the IPv6 address is 16 bytes.
- Section – This is the answer to the query.
- CNAME Record – This is the canonical name record.
You can export the results of the DNS cache using this command:
ipconfig /displaydns > dnscachecontents.txt
This will save the output in the text document, dnscachecontents.txt.
Also Read: [FIXED] Server DNS address could not be found on Windows 10/11
Method 2: Via PowerShell
You can view the DNS cache using Windows PowerShell. And like in Command Prompt, you can also export or save the database. Here’s the procedure:
- Press the
Windows + X
keyboard shortcut and select Windows PowerShell Admin. Alternatively, if you can’t find that option, press theWindows + S
shortcut keys, type in PowerShell, and select Run as Administrator on the right pane.
- Next, input the command
Get-DnsClientCache
, and press Enter. - Use the
Get-Help cmdlet
to get more information:
Help Get-DnsClientCache –full
Why Clear DNS Cache?
When you run into Internet connectivity issues, flushing or clearing the DNS cache usually resolves the problem. You may want to clear your DNS cache for a varied number of reasons, including:
- When attempting to troubleshoot connectivity issues, where you have difficulty accessing websites and applications: If the domain name in the cache has an incorrect or invalid IP address, the website won’t be able to return the correct information. If you clear your browser history, the DNS cache will still contain the old corrupt details. Flushing helps to get the DNS to update the results.
- When attempting to troubleshoot or resolve DNS spoofing or DNS cache poisoning issues: Cybercriminals may try to access the cache and insert or change the IP address to redirect you to a website designed to gather sensitive data like passwords and banking details. Clearing the DNS cache prevents this.
- Protecting your privacy: Although the DNS cache does not contain personal data like cookies or JavaScript, it retains a history of addresses you’ve visited recently and those you visit frequently. Such information can be dangerous in the hands of a skilled hacker. By clearing the DNS cache, you erase your address history, making it less likely for a hacker to track your online behavior.
- Resolving stale or outdated information about visited sites: An example here would be if a website has moved servers.
Also Read: Boost Internet on Your PC: Tips on How to Speed Up Your Internet Connection
Is It Safe to Flush the DNS Cache?
It is important to note that flushing the DNS cache doesn’t negatively impact your system. DNS cache ensures quick access to websites, and when you clear it the first time you visit a website, it may take longer than usual to load. But afterwards, the results will be quicker again.
Related: How to Delete Temporary Internet Files?
How to Clear DNS Cache
To clear the DNS cache, you can use a command line or Windows PowerShell for whatever reason.
Method 1: Clear DNS Cache using Command Prompt
- Press the
Windows Key + S
, and type CMD. - Choose the Run as administrator option in the right pane.
- Type the following command in the prompt and hit Enter:
ipconfig/flushdns
That’s it! You should get a notification indicating the cache has been successfully flushed.
If the issue is on the server instead of the local machine, you can still use Command Prompt to clear the DNS cache, but with a different command. In that case, the command would be:
dnscmd /clearcache
Method 2: Clear DNS Cache using Windows PowerShell
You can also flush the DNS cache using Windows PowerShell. Depending on the type of cache you want to clear, you have a few options to implement:
- To clear the local DNS server cache, use the command line:
Clear-DnsServerCache
- To clear the client cache, use this command:
Clear-DnsClientCache
How to Disable DNS Cache in Windows 10
If, for any reason, you wish to disable the DNS cache on your Windows 10 PC, you can use the “Service Controller” tool to stop the service:
- Press the Win + R keys, type in
services.msc
, and press Enter or click OK.
- Locate the DNS Client service (or Dnscache on some computers) and double-click it to open its Properties.
- Change the Startup Type to Disabled.
- To re-enable the service, repeat the steps above and change the Startup Type to Automatic.
Alternatively, you can deactivate the DNS Client using Windows System Configuration:
- Press the
Win + R
keys, type inmsconfig
in the Run dialog box, and hit Enter or click OK.
- Move to the Services tab and find DNS Client.
- Uncheck the box next to the service and click Apply > OK.
- To re-enable the service, repeat the steps above and tick the checkbox again.
Keep in mind that disabling this service will affect your computer’s overall performance. The network traffic for DNS queries will increase, so websites will load much slower than normal.
How to View DNS Cache on Windows 11?
Windows 11 has several substantial upgrades: performance optimization, bug fixes, new Taskbar and Start Menu placements, and more.
However, regarding basic functionality, Windows 11 works like Windows 10.
If you are trying to view the DNS cache on Windows 11, you can use the methods mentioned above for Windows 10.
Namely, you can view the cache by running elevated Command Prompt or via Windows Powershell — simply go through the steps for both methods described above.
If you are looking to clear the DNS cache on Windows 11, you can also follow the same steps as listed above for Windows 10. You can clear the cache by running a command in Command Prompt.
You can also do the same via Windows PowerShell.
Follow the steps above to Clear the DNS Cache on Windows 10. You can also follow the same steps to re-enable the service.
Please note that if you decide to disable the DNS cache on Windows 11, your system’s overall performance will be affected.
The traffic for DNS queries will substantially increase, and you will notice that many of the websites you visit frequently take much longer to load.
If you choose to disable the DNS cache on your PC, you will also lose the option to view the cache if you need to diagnose an issue on your system.
In 2022, a staggering 493 million ransomware attacks were detected worldwide, with phishing attacks still remaining the most common type of cybersecurity threat. Globally, the average damages associated with data breaches amounted to $4.35 million in 2022. These are scary facts – but they are a good illustration of why you should always protect your privacy. While clearing the DNS cache is important for protecting your privacy and preventing instances of hacking, it won’t remove all traces of sensitive information. These details include activity history, login details, profile data, and traces of visits to adult websites. Even if you didn’t open them knowingly, you might have been redirected without your knowledge. To effectively remove such sensitive data and protect your privacy, you need a reliable program like Auslogics BoostSpeed. The tool helps to clear any kind of confidential information that you wouldn’t want anyone to find. BoostSpeed has all the functionality you might need to keep your PC performing at optimal speeds and protect privacy. You will especially find the features under the “Browser Protect” tab quite useful.
Apart from clearing traces of your activities in your web browsers, system files, and applications, there is also an option to protect your DNS from unauthorized changes.
This way, you won’t be worried about DNS spoofing, where attackers alter your DNS records to redirect traffic to fraudulent websites.
If you enable Active Browser AntiTracker, your browsing data will be cleared after every browsing session, safeguarding your privacy.
We recommend cleaning up your PC regularly, depending on your usage. Since it’s easy to forget to run maintenance, you can activate an automated scan and choose how often you want the scan to run.
Download Auslogics BoostSpeed
Your one-stop PC maintenance and optimization tool, this program will clean, speed up, repair and tweak your system to ensure maximum speed and efficiency.
Also Read: Tricks to Get the Most out of Auslogics BoostSpeed Free Trial
Conclusion
Managing your DNS cache on Windows 10/11 is a straightforward process that can improve your internet experience.
Viewing the cache lets you see which domain names have been resolved recently. Clearing it can help resolve connectivity issues, ensure privacy, and keep your system up-to-date.
Following the simple steps outlined in this guide, you can easily view and clear your DNS cache, ensuring a smoother and more secure online experience.
FAQ
How to check DNS settings in Windows 10?
To check your DNS settings in Windows 10, follow these steps:
- Right-click on the Start button and select Network Connections or Network & Internet Settings.
- Click on Change adapter options.
- Right-click on your active network connection and choose Properties.
- Scroll down and find Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6) depending on your network.
- Click Properties to view and edit your DNS settings.
Where are the DNS address resolutions stored?
DNS address resolutions are stored in your operating system’s DNS cache. In Windows, you can view and manage this cache using the Command Prompt or PowerShell with commands like ipconfig /displaydns
or Clear-DnsClientCache
.
What information is kept in the DNS resolver cache?
The DNS Resolver Cache stores information related to domain name resolutions, including the domain names and their corresponding IP addresses.
It may also contain information about recent network connections and domain-related settings.
How long does DNS cache last?
The duration for which DNS cache entries last can vary. DNS records have a time-to-live (TTL) value, set by the domain’s authoritative DNS server.
Cache entries typically expire when the TTL value reaches zero, or when the cache is manually cleared. Common TTL values range from a few minutes to several days, depending on the domain and its configuration.