죄송합니다. 이 페이지의 콘텐츠는 선택하신 언어로 제공되지 않습니다.

주요 내용으로 건너뛰기

DNS query

DNS query

(also DNS request)

What is a DNS query?

A DNS query is a message your device sends to find the IP address of a website you want to visit. When you enter a domain name like example.com, your device cannot reach it until it knows the site’s numerical address — for example, 93.184.216.34. This short request-and-response step is what allows your browser to connect to the right server and load the website. Without it, your browser would not know where to connect, and websites simply wouldn’t load.

See also: Domain Name System (DNS), DNS proxy, Iterative DNS query, Recursive DNS server

What’s in a DNS query?

A DNS query includes a few basic parts that tell a DNS server exactly what your device wants to know:

Header.
Contains the query ID and flags, which help DNS servers understand what kind of request they are handling.

Question.
Specifies the domain name your device is asking about.

Class.
Indicates the category of the request. For regular internet lookups, the class is usually IN (Internet).

Types of DNS queries

DNS queries can be handled in several ways:

  • Recursive DNS query: The DNS server itself tracks down the DNS record by making a series of DNS requests until it reaches the Authoritative Name Server with the IP address of the requested hostname.
  • Non-recursive DNS query: The DNS server either already has the required DNS record in its cache or knows where to get it, so there is no need for more than one query.
  • Iterative DNS query: If it does not have the requisite IP address in its cache, the DNS server queried refers the client to another DNS server to continue the search.

DNS queries can also request different types of DNS records, depending on what your device needs. Common record types include:

  • A – IPv4 address
  • AAAA – IPv6 address
  • MX – Mail server information
  • CNAME – Canonical name (an alias for another domain)
  • NS – Nameserver information

How DNS query works

The general process your device follows when resolving a domain name starts with a:

  1. 1.User request: When you enter a domain name into a browser, your device (the DNS client) sends a query to a DNS resolver — often your ISP’s resolver or a third-party DNS service. The goal is to find the website’s IP address, such as 93.184.216.34, so your device knows where to connect.
  2. 2.DNS cache check: The resolver first checks its local cache to see if it already has the IP address for the domain. If it does, it returns the result instantly.
  3. 3.Recursive query: If the IP isn’t cached, the resolver starts a recursive query, reaching out to a root DNS server to locate the top-level domain (TLD) server (e.g., ".com").
  4. 4.TLD server: The TLD server directs the resolver to the authoritative DNS server responsible for the specific domain name (like "example.com").
  5. 5.Authoritative server response: The authoritative server provides the IP address for the domain.
  6. 6.Result returned: The resolver sends the IP address back to your device, which can now use it to connect to the web server and load the website.

How can you use dig to query specific DNS servers?

The dig tool lets you look up DNS information manually. It’s often used to check whether different DNS servers return the same results. 

Example command:
dig @1.1.1.1 example.com A

What this means:

  • @1.1.1.1 — Ask Cloudflare’s DNS server.
  • example.com — The domain name you want to look up.
  • A — Request the IPv4 address record.