Посмотреть dns записи windows

Download Windows Speedup Tool to fix errors and make PC run faster

In this post, we will show you how to view the DNS cache contents in Windows 11/10. DNS cache refers to the temporary storage of information about previous DNS lookups on a machine’s OS or web browser.

View DNS cache contents cmd

The DNS cache contains a list of remote server names and the IP addresses (if any) they correspond to. Entries in this cache come from DNS lookups that happen when attempting to visit Web sites, named FTP servers, and other remote hosts. Windows uses this cache to improve the performance of Web-based applications.

Using Command Prompt

To view the DNC cache contents, execute the following command in an elevated CMD:

ipconfig /displaydns

The results will be displayed.

  • Record name is the name you query DNS for, and the records belong to that name.
  • Record type is the type, displayed as a number or name. In the DNS protocol, each has a number.
  • Time To Live is the time in seconds after which the cache entry must expire.
  • Data Length is the length in bytes, eg- An IPv4 address is 4 bytes; IPv6 is 16 bytes.
  • Section of a DNS reply is the actual answer to the query,
  • Additional contains information that will likely be needed to find the actual answer.
  • CNAME is the canonical name.

If you wish to export the results, you can use the command ipconfig /displaydns > dnscachecontents.txt to save the output in the text document dnscachecontents.txt.

Using PowerShell

If you wish to get you the same information as a collection of DNS record objects which can easily be exported or saved in a database, run the following cmdlet in PowerShell:

Get-DnsClientCache

This command will list the Help information:

Help Get-DnsClientCache -full

You can also use the following command to get better formatting:

Get-DnsClientCache | Format-Table -AutoSize

How to clear the DNS cache

You can use the command to flush DNS Cache in the command prompt:

ipconfig /flushdns

Our freeware FixWin for Windows, let you flush the DNS cache, etc., in a click.

Turn Off or Turn On DNS Cache

To turn off DNS caching for a particular session, type net stop dnscache and hit Enter.

To turn on DNS caching, type net start dnscache and hit Enter.

Of course, when you restart the computer, the DNC caching will, in any case, be turned on.

Disable DNS Cache

If for some reason you wish to disable DNS caching, type services in Start search and hit Enter to open the Services Manager. Here locate the DNS Client service.

The DNS Client service (dnscache) caches Domain Name System (DNS) names and registers the full computer name for this computer. If the service is stopped, DNS names will continue to be resolved. However, the results of DNS name queries will not be cached and the computer’s name will not be registered. If the service is disabled, any services that explicitly depend on it will fail to start.

Double-click on it to open its Properties box. Here change its startup type from Manual to Disabled. If you disable the DNS Client service, DNS Lookups may take longer.

These resources may also interest you:

  1. How to change DNS settings in Windows
  2. Manage web browsing speed by changing DNS settings
  3. Check if your DNS settings have been compromised.

Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP (2006-16) & a Windows Insider MVP (2016-2022). Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.

Обратите внимание. В мае 2025 года существенное снизились цены на вечные виртуальные серверы VPS/VDS в России и Нидерландах. Для читателей блога дополнительная скидка 10%. Подробнее.

При внесении изменений в записи NS-серверов для вашего домена, полезно знать как эти данные подхватывают DNS серверы по всему миру, в том числе и у вашего провайдера. В этой статье я опишу как быстро и просто это сделать с помощью встроенных средств операционной системы Windows или он-лайн в окне браузера.

Как проверить DNS записи доменного имени в Windows

В операционной системе Windows есть полезная утилита nslookup, которая позволит узнать значения необходимых вам DNS записей. Для ее использования нам понадобится консоль. Вызвать ее в Windows 10 можно сочетанием клавиш [Win]+[R].

Далее набрать команду cmd и нажать клавишу [OK]

Использование nslookup в Windows для проверки записей для доменного имени

По-умолчанию, если выполнить команду nslookup domainname.tld (где domainname.tld — доменное имя) вы получите информацию о А-записи запрашиваемого доменного имени через DNS сервер по-умолчанию (обычно это ваш шлюз, роутер). Например:

>nslookup yandex.ru
Сервер:  192.168.204.2
Address:  192.168.204.2

Не заслуживающий доверия ответ:
Имя:     yandex.ru
Addresses:77.88.55.50
          5.255.255.80
          5.255.255.88
          77.88.55.55

Чтобы посмотреть записи через другой DNS сервер, то есть увидеть какие значения записей для домена хранятся на другом DNS сервере, а они могут быть иными, выполните следующую команду: nslookup domainname.tld dns-server (где domainname.tld — доменное имя, а dns-server адрес стороннего DNS сервера, например 1.1.1.1 от CloudFlare).

>nslookup yandex.ru 1.1.1.1
Сервер:  one.one.one.one
Address:  1.1.1.1

Не заслуживающий доверия ответ:
Имя:     yandex.ru
Addresses:77.88.55.55
          5.255.255.88
          77.88.55.50
          5.255.255.80

Для просмотра других записей домена нужно команде nslookup добавить опцию -type=YYY, где YYY — тип проверяемой записи. Например для просмотра MX-записи используйте команду nslookup -type=mx domainname.tld.

>nslookup -type=mx yandex.ru
Сервер:  192.168.204.2
Address:  192.168.204.2

Не заслуживающий доверия ответ:
yandex.ru       MX preference = 10, mail exchanger = mx.yandex.ru

mx.yandex.ru    internet address = 77.88.21.249

Аналогично для других записей, а так же через альтернативные DNS.

Описание ресурсных записей для домена

Для того, чтобы настроить на своем домене сайт, почту или другие сервисы, потребуется в зоне домена указать соответствующие сервисам ресурсные записи.

Настройка ресурсных записей выполняется либо хостинг-провайдером автоматически, при создании сайта или почты в панели управления хостингом, либо администратором домена вручную с помощью специального редактора.

Базовые типы записей, с которыми работают администраторы и владельцы сайтов:

  • NS-запись — главный тип, определяющий адреса DNS-серверов, обслуживающих домен.
  • A-запись — привязывает доменное имя на один IP-адрес, используя протокол IPv4. Возможно использование более одного IP-адреса. Тогда добавляют вторую A-запись c другим IP-адресом. Если есть необходимость указания нескольких имен для одного IP, как правило, используют CNAME-запись для формирования псевдонимов (алиасов).
  • AAAA — тип записи, аналогичный предыдущей, но с IPv6-адресами.
  • CNAME — указывает, что данный домен выполняет функции псевдонима (алиаса) другого домена. Для псевдонима записи других типов не вносятся.
  • MX-запись — указывает имя сервера, ответственного за прием почты для домена. В зоне домена может быть несколько MX-записей с разными приоритетами.
  • TXT-запись — используется для хранения произвольной информации в DNS. Запись может использоваться для подтверждения владения доменом в р различных сервисах.
  • SOA-запись — содержит служебную информацию: доменное имя, время последнего обновления зоны домена, адрес администратора зоны, настройки временных параметров и другую информацию.

Корректность заполнения ресурсных записей важна для успешного делегирования домена и дальнейшего функционирования службы name-серверов.

Он-лайн проверка записей для домена

Он-лайн проверка DNS записей имеет преимущество в том, что вы можете сделать ее с любого устройства с браузеров и доступом в Интернет.

Проверка записей DNS с помощью Набора инструментов администратора от Google

Набор инструментов для администратора от Google содержит утилиту Dig, с помощью которой можно проверить все интересующие вас записи для домена.

Особенность данного сервиса в том, что проверка идет только через DNS серверы Google.

Он-лайн проверка DNS записей от регистратора REG.RU

Регистратор REG.RU предлагает свой сервис DIG для просмотра записей для домена.

У этого сервиса в отличии от Google есть возможность выбрать DNS сервер, чтобы посмотреть записи для домена.

Как проверить NS записи на всех DNS серверов сразу

Если вы хотите проверить записи для домена на всех (на большинстве популярных) DNS серверах, то можно воспользоваться сайтом https://www.digwebinterface.com/. Который грубо говоря представляет собой WEB оболочку для утилиты DIG.

Очень удобно прослеживать как ваши изменения для доменных записей реплицируются по DNS серверам мира.

Дополнительные сервисы для проверки

Я привел только самые удобные с моей стороны сервисы по проверки NS записей для доменного имени. Но есть и другие:

  1. https://2ip.ru/dig/
  2. https://dnschecker.org/

Возможно вам они понравятся даже больше.

Почему домены начинают работать не сразу

DNS-серверы интернет-провайдеров обновляются через определенные промежутки времени. Обычно от часа до суток. Если вы только что прописали или сменили DNS-серверы, то готовьтесь к тому, что внесенные изменения вы и посетители вашего сайта увидят через 24 часа. А полная синхронизация всех DNS серверов в мире может растянуться на трое суток.

Так же на скорость обновления значений влияет параметр TTL каждой ресурсной записи.

Благодарности

При написании статьи были использованы следующие ресурсы:

  1. https://www.nic.ru/help/chto-takoe-name-servery-ns_8578.html
  2. https://help.reg.ru/hc/ru/articles/4408047119761-Что-такое-DNS-простыми-словами

The Windows operating system uses a cache for DNS entries. DNS (Domain Name System) is a core technology of the Internet that is being used for communication. In particular, it is used to lookup IP addresses of domain names.

When users type a domain name in the browser, one of the first tasks that is executed when the site is loaded is to look up its IP address. The process requires access to DNS servers. Often, DNS servers of the Internet Service Provider are used automatically, but administrators may switch to other DNS servers, as these may be faster or offer better privacy.

Switching DNS providers may also help bypass Internet censorship, if DNS is used to block access to certain sites.

Windows uses the DNS resolver cache to speed up lookups. Each DNS lookup is added to the cache to speed up consecutive visits to the domains. Sometimes, entries may become old and may point to the wrong IP address. Our guide on fixing resolving host issues in browsers is still valid up to this day.  Flushing the cache may help with that, as it removes all cached items to start from scratch.

Tip: you may use the free software DNSLookupView to log all DNS activity on Windows.

Display all cached DNS entries

ipconfig dns

The list of  cached entries can be useful for a number of purposes. Webmasters and developers may check if the correct IP address is assigned to a property, and users may be interested in seeing all entries, e.g., to find out which domains have been accessed during a session.

  1. Open the run box with the shortcut Windows-R.
  2. Type cmd.exe and hit the Enter-key.
  3. Type ipconfig /displayDNS to run the command.

Windows returns all cached DNS entries in a long list. You may also redirect the output to a plain text file by running the command ipconfig /displayDNS > %USERPROFILE%\Desktop\dns.txt. This saves the output to the file dns.txt on the desktop.

The very same command can also be run using PowerShell:

  1. Open Start, type PowerShell and select the result. If you have Terminal installed, type Terminal instead and select that result.
  2. Run the command powershell «Get-DnsClientCache | Format-Table -AutoSize».

The output uses better formatting. You may redirect the output to a text file as well using the command  powershell «Get-DnsClientCache | Format-Table -AutoSize» >%USERPROFILE%\Desktop\DNS.txt.

To flush the DNS cache, run the command ipconfig /flushdns. Check out this guide if you are getting the error Could not flush the DNS Resolver.

Now You: which DNS provider do you use? (via Eleven Forum)

Summary

Article Name

How to display all cached DNS entries on Windows

Description

Find out how to display all DNS entries that have been cached by the Windows operating system.

Author

Martin Brinkmann

Publisher

Ghacks Technology News

Logo

Advertisement

There are many reasons why you might need to check the status of your Domain
Name System (DNS) records. For example, you might need to verify that updates
are correct or troubleshoot issues with accessing a service.

If you’re a Cloud DNS user, you can
view your DNS records through the Cloud Control
Panel. In addition, Microsoft® Windows®
offers nslookup, a built-in tool for checking your DNS records from the
command line.

To access nslookup, open a command prompt window by selecting Start >
All Programs > Accessories > Command Prompt
.

To check a specific DNS record, you need to specify the nslookup command,
an optional record type (for example, A, MX, or TXT), and the host name
that you want to check.

Note: If you omit the record type, it defaults to A.

The following example shows how to check A records for rackspace.co.uk:

C:\Users\Administrator>nslookup rackspace.co.uk
Server:  cachens1.lon.rackspace.com>
Address:  83.138.151.80

Non-authoritative answer:

Name:    rackspace.co.uk
Address:  212.64.133.165

The first two lines of output specify the server to which the request
was directed. This server is the default server that your system uses for DNS
name resolution.

The second section gives the name of the record and the corresponding Internet
Protocol (IP) address. However, the answer in this section is
non-authoritative because it originates from a server
(cachens1.lon.rackspace.com) that isn’t the root source for those records.

To get an authoritative answer you need to specify the authoritative (primary)
name server at the end of the request.

Use the -type=soa option to tell nslookup to display the
authoritative name server, as shown in the following example:

C:\Users\Administrator>nslookup -type=soa rackspace.co.uk
Server:  cachens1.lon.rackspace.com>
Address:  83.138.151.80

Non-authoritative answer:
rackspace.co.uk
        primary name server = ns.rackspace.com
        responsible mail addr = hostmaster.rackspace.com
        serial  = 1415913000
        refresh = 3600 (1 hour)
        retry   = 300 (5 mins)
        expire  = 1814400 (21 days)
        default TTL = 300 (5 mins)

ns.rackspace.com        internet address = 69.20.95.4

The address labeled primary name server is the DNS authority for the
domain.

If you add the address of the authoritative name server
(ns.rackspace.com) to the first command, the record is now checked
against that name server.

C:\Users\Administrator>nslookup rackspace.co.uk ns.rackspace.com
Server:  ns.rackspace.com
Address:  69.20.95.4

Name:    rackspace.co.uk
Address:  212.64.133.165

DNS uses caching, which reduces the load on authoritative name servers.
However, as a result, records might be outdated. If the authoritative and
non-authoritative answers differ, you have a cached response from the resolver
name server that you’re using. The length of time that a record is cached
depends on its time-to-live (TTL) value. The TTL is a number that is
specified in seconds.

To see how long a record is cached, include the debug option, as shown in
the following example:

C:\Users\Administrator>nslookup -debug rackspace.co.uk

------------

Got answer:
HEADER:
        opcode = QUERY, id = 1, rcode = NOERROR
        header flags:  response, want recursion, recursion avail.
        questions = 1,  answers = 1,  authority records = 2,  additional = 2

    QUESTIONS:
        80.151.138.83.in-addr.arpa, type = PTR, class = IN
    ANSWERS:
    ->  80.151.138.83.in-addr.arpa
        name = cachens1.lon.rackspace.com
        ttl = 2466 (41 mins 6 secs)
    AUTHORITY RECORDS:
    ->  151.138.83.in-addr.arpa
        nameserver = ns2.rackspace.com
        ttl = 2466 (41 mins 6 secs)
    ->  151.138.83.in-addr.arpa
        nameserver = ns.rackspace.com
        ttl = 2466 (41 mins 6 secs)
    ADDITIONAL RECORDS:
    ->  ns.rackspace.com
        internet address = 69.20.95.4
        ttl = 12982 (3 hours 36 mins 22 secs)
    ->  ns2.rackspace.com
        internet address = 65.61.188.4
        ttl = 12985 (3 hours 36 mins 25 secs)

------------

Server:  cachens1.lon.rackspace.com
Address:  83.138.151.80

------------

Got answer:
    HEADER:
        opcode = QUERY, id = 2, rcode = NOERROR
        header flags:  response, want recursion, recursion avail.
        questions = 1,  answers = 1,  authority records = 2,  additional = 2

    QUESTIONS:
        rackspace.co.uk, type = A, class = IN
    ANSWERS:
    ->  rackspace.co.uk
        internet address = 212.64.133.165
        ttl = 279 (4 mins 39 secs)
    AUTHORITY RECORDS:
    ->  rackspace.co.uk
        nameserver = ns.rackspace.com
        ttl = 17465 (4 hours 51 mins 5 secs)
    ->  rackspace.co.uk
        nameserver = ns2.rackspace.com
        ttl = 17465 (4 hours 51 mins 5 secs)
    ADDITIONAL RECORDS:
    ->  ns.rackspace.com
        internet address = 69.20.95.4
        ttl = 15754 (4 hours 22 mins 34 secs)
    ->  ns2.rackspace.com
        internet address = 65.61.188.4
        ttl = 15727 (4 hours 22 mins 7 secs)

------------

Non-authoritative answer:

Name:    rackspace.co.uk
Address:  212.64.133.165

The response includes the following information:

  • The first Got answer section of this example is used to get the
    host name of the server from which you are requesting the A record.
    In this example, the host name is cachens1.lon.rackspace.com.
  • The second Got answer section relates to your actual request.
  • The HEADER section contains details about the type of request and
    its success.
  • The QUESTIONS section shows that the request was for A records
    for rackspace.co.uk.
  • The ANSWERS section displays one record with an IP address of
    212.64.133.165 and a TTL of 279 seconds (4 minutes 39 seconds).
  • The AUTHORITY RECORDS section specifies the name servers that
    correspond to the domain.
  • The ADDITIONAL RECORDS section lists A records for the name servers
    that are listed in the authority records section.

This response shows that the name server that the client computer uses will
reuse the same A record for rackspace.co.uk for the next 4 minutes and 39
seconds. If you run the same command on the authoritative name server, you
see the current maximum TTL for the record.

Updated over 1 year ago


In this tutorial, you will learn how to use nslookup to check DNS records.

I’ll show you how to check several DNS record types (A, PTR, CNAME, MX, etc) by using the windows nslookup command.

And in this post, I’ll show you how to use nslookup against your local DNS server and an external DNS server (great tip for troubleshooting).

Let’s get started!

Table of Contents:

  • How DNS Works
  • Why you must learn the nslookup command
  • Nslookup Syntax
  • How to use nslookup to check DNS records
  • DNS Troubleshooting Tips

How DNS works

Understanding how DNS works will help you troubleshoot DNS issues faster. It will help you identify if it’s a client, a local DNS issue, or another DNS server (forwarding server or ISP).

Computer and other network devices communicate by IP address. It would be hard to remember the IP address of every website or resource you access, domain names are easier to remember. DNS will take the easy to remember name and map it to the IP address so devices can communicate.

Below I walk through how a computer uses DNS to resolve names.

  1. User types in google.com into their browser. This will send a query to the DNS server to go fetch the IP address for google.com
  2. The DNS server that the client uses may not know the IP address. This can be your local Active Directory DNS server or your ISP DNS server. If it doesn’t know the IP address of the domain it will forward it on to the next DNS server.
  3. The next DNS server says it knows the IP address and sends the request back to the computer.
  4. The computer is then able to communicate to google.com.

DNS uses resource records to provide details about systems on a network. The above example used an A resource record which maps a domain name to an IP address.

In the examples below I will show you how to query different resource records.

Why you must learn the Nslookup command line tool

When DNS is not working devices cannot communicate. You will be unable to browse websites, send an email, chat online, stream videos, and so on.

If you have a local DNS server issue then your employees can’t work and business is impacted.

You need a way to quickly troubleshoot and resolve these issues.

That is why it’s important to know how to use the Nslookup command.

This command is built into all Windows operating systems, it’s free and easy to use.

If you are a system or network administrator it’s very important that you know how to quickly resolve DNS related issues.

NSLookup Syntax

To view the syntax just type nslookup hit enter then type?

Here is a screenshot

There are a lot of options but in most cases, you will only need a few of them to verify DNS records. The most useful command switches are set type, server, and debug. I’ll show you the most commonly used commands below.

How to Use Nslookup to Check DNS Records

Below are several examples of how to use nslookup to check various DNS record types. By default, nslookup will use the local DNS server configured by your computer. See the last example to change Nslookup to use an external server.

Nslookup IP Address (IP to Domain Name)

nslookup 8.8.8.8

Use this command if you know the IP address and want to find the domain name. In the screenshot below the IP 8.8.8.8 resolves to the domain name dns.google.com

Nslookup domain name (Domain to IP Address)

nslookup domainname

If you want to find the IP address of a domain name then use this command. In this example, the domain name ad.activedirectorypro.com resolves to several IP addresses.

Nslookup MX record

nslookup -type=mx domainname

An MX record lookup will find the mail server that is responsible for accepting emails for the domain. To find the MX records use -type=mx followed by the domain name.

Nslookup SOA Record

nslookup -type=soa ad.activedirectorypro.com

The Start of Authority record indicates which DNS server is the best source of information for the domain. This will return the primary name server, responsible mail addresses, default ttl, and more.

Nslookup CNAME

nslookup -type=cname www.activedirectorypro.com

The CNAME record is used to alias or redirects one DNS name to another DNS name.

Nameserver lookup

nslookup -type=na ad.activedirectorypro.com

Use the above command to view the name servers for a domain. You can see below the name servers for my domain are dc1, dc2 and dc3.

Nslookup TXT record

nslookup -type=na domainname

Use this command to view text DNS records for a domain.

Nslookup all DNS records

nslookup -type=any ad.activedirectorypro.com

This command will display all available records.

Nslookup domain controller

Use these steps to list all domain controllers for a specific domain.

  1. From the command prompt type nslookup and press enter
  2. Then type set type=SRV and press enter
  3. Next, type _ldap._tcp.ad.activedirectorypro.com and press enter. (replace ad.activedirectorypro.com with your domain name).

This will display all domain controllers for the ad.activedirectorypro.com domain.

Nslookup Verbose

Turning on debug will display a lot more details about the resource record such as primary name server, mail address, default TTL, and much more. To turn on debug use the command below

nslookup 
set debug

Nslookup use External DNS server

This is very useful in troubleshooting. Maybe a website isn’t loading on your internal network but does when you are off the network. You can use this to see if your internal DNS is returning different results than an external DNS server. You can use your ISP DNS server or google.

To change the DNS server type nslookup and press “enter”.

Then type server IPADDRESS. For example “server 8.8.8.8” and press enter. This will instruct the nslookup command to use the 8.8.8.8 server to run DNS record lookups.

Tips for troubleshooting DNS Problems

Here are my tips for troubleshooting DNS issues.

Step#1 Make sure you have connectivity to the DNS server?

If your client has communication issues with the DNS server then name resolution is not going to work.

To check what DNS is set on a Windows system use this command:

ipconfig /all

Now take the IP listed for the DNS server and see if the client can ping it or communicate with it.

Step #2 Are other users or devices having name resolution issues?

You need to determine how big of a problem you have. Is it just one, two, or many devices that have name resolution issues?

If it’s just one then you may just have a client issue. If it’s all or many then you may have an issue with the local or upstream DNS server.

Step #3 Use NSLookup to test local server

Use NSLookup to verify the local DNS server is working correctly. Use the command to verify DNS records on local servers. If you need examples see the previous section.

If you are having issues internally you will want to check the health of your Active Directory environment. Since DNS and AD are very tightly integrated a faulty domain controller could be causing your DNS issues. 
See my tutorial on how to check domain controller health.

Step #5 Use NSlookup server to test forwarding DNS Server (UPstream)

If everything is resolving correctly internally but not externally you can test the forwarding DNS server with the NSLookup command. This could be your ISP DNS server or the root hint servers. Use NSLookup server option followed by the forwarding DNS server IP to run queries.

Step #6 Scan for viruses and spyware

Viruses and spyware can install all kinds of nasty things on computers to redirect traffic to malicious sites. Browser hijacking is very common

Step #7 Check the client’s host file

I don’t recommend adding entries to the host file but if it contains incorrect or outdated data, you won’t be able to connect. Viruses can also modify the host file which would redirect you to malicious websites.

Step #8 Flush DNS Cache

The client’s cache could be the problem to flush the cache run this command

ipconfig /flushdns

I hope this article helped you understand the NSLookup and how it can be used to verify and troubleshoot DNS. If you liked this video or have questions leave a quick comment below.

Summary

In this guide, I walked through several examples of how to use the nslookup windows command. The nslookup command is a great tool to troubleshoot and check DNS records. A lot of times network issues are related to DNS and knowing how to quickly verify DNS is working correctly can be a huge time saver.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Hp officejet pro 8610 pro драйвер windows
  • Эволюция windows 1985 2021
  • Как сделать pro версию windows
  • Возникла проблема ваш пин код недоступен windows 10 безопасный режим
  • Фальшивое обновление windows 10