Мой локальный компьютер работает как DNS-сервер?

929
Wissam A Jackal

Я хочу знать, работает ли мой локальный компьютер как DNS-сервер.

Я имею в виду, когда он пытается разрешить интернет-адреса, он сначала смотрит на него? Мол, есть ли кэш DNS в Windows 7 или интернет-браузере? Или он начинает спрашивать роутер, который работает как кеш DNS?

Пожалуйста, я хочу получить полное описание, как это работает, потому что я запутался, когда начинается процесс разрешения DNS.

1
Да, ваш компьютер хранит локальный DNS-кеш. Вы можете очистить его, используя `ipconfig / flushdns` в окнах, используя права администратора. Используйте `sudo dscacheutil -flushcache` для MacOS. В Linux это меняется в зависимости от используемого демона, но обычно вы используете либо аналогичную команду сброса, либо перезапускаете / перезагружаете демон. Roh_mish 7 лет назад 0
спасибо большое, так что компьютер хранит кэш днс не браузер верно ?! затем (в случае, если результат не найден) он перенаправляет запрос в маршрутизатор dns и т. д. Wissam A Jackal 7 лет назад 0
Chrome также хранит локальный кеш, который вы можете очистить, перейдя в `chrome: // net-internals / # dns` и затем ** очистить кеш хоста ** Roh_mish 7 лет назад 0
Chrome смотрит на свой собственный кеш, если он не может найти запись, которую он перемещает в локальный кеш вашего ПК, а затем маршрутизатор к DNS вашего интернет-провайдера, если вы используете его, и вверх по цепочке, пока не найдет соответствующую запись. Roh_mish 7 лет назад 0
Большое спасибо, мой друг, последнее, DNS относится к системе доменных имен (или к службе или серверу), верно ?! все три одинаковые? Wissam A Jackal 7 лет назад 0
Вы можете сказать, что все три одинаковы. Но в правильном смысле сервер - это выделенный сервис, обеспечивающий разрешение DNS. Служба может быть запущена либо на сервере как общедоступная (открытая для более чем самого сервера. Может быть для частной организации), либо в вашей системе для кэширования запросов или хранения записей специальных запросов. Roh_mish 7 лет назад 0
спасибо мой друг за быстрое воспроизведение, у меня появилась идея .... с уважением Wissam A Jackal 7 лет назад 0

1 ответ на вопрос

7
Fazer87

Your machine will always check its local cache first to save having to ask a DNS server a question that it already knows the answer to. You can see this by opening a command prompt and running the following command:

ipconfig /displaydns 

local DNS Cache


if your machine cannot get an answer from your DNS cache, it will ask it's primary DNS server, which will in turn check it's own database and give you a reply. For home users, it is most likely your router. You can find your DNS server by running the following command:

ipconfig /all 

enter image description here


If there is no reply from your primary DNS, your computer will ask it's secondary DNS (if you have one configured) and then it's third and then it's fourth.. and so on.

If your primary DNS is online but doesn't have the answer, it will in turn ask it's own primary DNS (probably your ISP for most home users). Your ISP will then check its own DNS and serve a reply to your router which will serve it to you.

If your ISP DNS doesn't have the record, it will start asking it's configured roots or forwarders. These are a list of places configured inside DNS that are used when the DNS server itself doesn't know where to get an answer from. These are typically other DNS Servers, or internet root name servers.


Further Reading:

How DNS query works

Domain Name System - Hill Associates

DNS Namespaces - Google (particularly look at the Namespaces section)


Diagnosing DNS problems

Some applications store their own DNS cache. Web browsers are a prime example of this. As there are billions of applications in the world, millions of which (possibly) store a DNS cache - I'm not going to start listing possible ways to flush it. If you suspect an address is being cached - prove it (example - chrome fails to resolve a site name but Firefox is OK - it may be a chrome cache issue) and then google how to clear cache for that specific application.

NSLOOKUP www.google.com - this command (when entered into a command prompt) will give you a DNS lookup for www.google.com and return its ip: enter image description here

IPCONFIG /flushdns - this command will flush your local DNS cache and help get rid of any bad results you have stored locallyenter image description here

Lastly, if you are getting poor name resolution or lots of lookup failures from your ISP, there are loads of alternative DNS servers you can add to your router or PC to do name resolution more reliably. Although I use my corporate DNS servers and ISP for most of my stuff, the google DNS service is pretty good. Check out this link for more info

(lastly, apologies for the poor screenshots - I'm at work and can't post better ones without blanking out most of the data - I found these on the net)