DEV Community

Cover image for What is DNS and what is it used for?
Techelopment
Techelopment

Posted on

What is DNS and what is it used for?

The Domain Name System, also known as DNS, is one of the key mechanisms of the Internet, responsible for translating domain names into IP addresses. In other words, DNS allows a user to access a website using a domain name, such as www.google.com, instead of having to enter a numeric address (IP address) of the server. In this article, we will explain how DNS works, what it is used for, and why it is essential for smooth navigation.

🔗 Do you like Techelopment? Check out the site for all the details!

What is DNS?

Think of DNS as an addressing system similar to the one we use for homes, where domain names are "street addresses" and IP addresses are "geographic coordinates." While a street address gives us an intuitive and easy-to-remember direction (such as "10, 2001 Broadway"), geographic coordinates (for example, "47.6372° N, -122.3226° W") are unique and identify the precise location of the place, but are not as easy to remember.

Similarly, the Internet works by associating easy-to-remember domain names with complex IP addresses that computers can read and use to navigate to the precise destination. So instead of remembering a series of numbers, such as the IP address 142.250.64.78 to access Google, users simply type www.google.com. DNS does the "translation" between the street address (domain name) and the corresponding precise coordinates (IP address).

How does DNS work?

DNS resolution - the translation of a domain name into an IP address - occurs in several stages, similar to how a person might consult a map to find an address.

Here are the main steps:

  1. DNS query: When we type a domain name into a browser, the system sends a request to a DNS server, which looks up the associated IP address.
  2. Recursive DNS server: If the local DNS server does not have the requested information in memory, it forwards the request to a recursive server, which takes care of finding the exact address.
  3. DNS Root Server: The recursive server contacts one of the DNS root servers, which do not know the individual address but provide broader information, such as "neighborhoods" (i.e. top-level domains such as .com, .org, .it).
  4. TLD (Top-Level Domain) Server: The root server directs the request to the TLD server corresponding to the main domain (for example .org for wikipedia.org). This server provides the information on where to find the full address.
  5. Authoritative Server: Finally, the authoritative server is the one that has the exact address for the domain and returns the associated IP address.
  6. Accessing the website: With the IP address in hand, the browser can finally "find the right home", that is, the server that hosts the site, and display its contents.

What is DNS for?

DNS makes browsing the Internet simple and accessible, allowing you to avoid remembering numerical sequences.

Some of the main advantages of DNS include:

  • Ease of use: Thanks to DNS, we can access websites using easy-to-remember names, such as google.com, instead of having to remember the IP address.
  • Scalability: DNS is built to be able to handle billions of domains thanks to its hierarchical structure.
  • Speed ​​and cache: DNS servers can cache requests, making it faster to access previously visited sites.
  • Resilience: The DNS structure is distributed and redundant, ensuring a constant connection even if some servers fail.
  • Security: DNS, with tools like DNSSEC, helps protect users from cyber attacks such as DNS spoofing, preventing redirects to fraudulent sites.

DNS problems and risks

DNS, despite being essential, can have some vulnerabilities:

  • DNS spoofing: Cyber ​​attacks can manipulate DNS, redirecting users to malicious sites.
  • DNS server DDoS: DDoS attacks can overload DNS servers, making sites inaccessible (as happened in the early 2000s 😱).
  • Privacy tracking: Since DNS requests are visible to network providers, they can be used to track user activity.

How to change DNS: Why do it?

Changing your DNS server can improve browsing speed, solve problems accessing certain sites, and improve security. Using faster or more specific DNS (like Cloudflare, OpenDNS or Google) can optimize your browsing experience and block some unwanted content.

Changing DNS in Windows:

  • Go to Settings > Network & Internet > Advanced settings
  • Choose your network (Wifi or Ethernet) and click Change adapter settings.
  • In the properties of the TCP/IPv4 protocol, enter the preferred DNS address.

Changing DNS on mobile devices:

  • On Android and iOS, you can set custom DNS in the Wi-Fi network settings.

Another way to change DNS could be to act on the router settings if it allows it.


Follow me #techelopment

Official site: www.techelopment.it
Medium: @techelopment
Dev.to: Techelopment
facebook: Techelopment
instagram: @techelopment
X: techelopment
telegram: @techelopment_channel
youtube: @techelopment
whatsapp: Techelopment


References

Domain Name System (DNS)

Top comments (0)