#readwise # Network Foundations - Domain Name System (DNS) ![rw-book-cover](https://readwise-assets.s3.amazonaws.com/static/images/article3.5c705a01b476.png) ## Metadata - Author: [[Hack The Box]] - Full Title: Network Foundations - Domain Name System (DNS) - URL: https://academy.hackthebox.com/module/289/section/3241 ## Summary The Domain Name System (DNS) helps us find the IP addresses of websites using easy-to-remember names like www.google.com. It acts like an internet phonebook, allowing us to avoid memorizing complex numbers. When we type a website name, DNS quickly translates it into the correct IP address. This process happens in fractions of a second, making our online experience seamless. ## Highlights DNS is organized like a tree, starting from the root and branching out into different layers. | Layer | Description | | -------------------------- | --------------------------------------------------------------------------------- | | `Root Servers` | The top of the DNS hierarchy. | | `Top-Level Domains (TLDs)` | Such as `.com`, `.org`, `.net`, or country codes like `.uk`, `.de`. | | `Second-Level Domains` | For example, `example` in `example.com`. | | `Subdomains or Hostname` | For instance, `www` in `www.example.com`, or `accounts` in `accounts.google.com`. | ([View Highlight](https://read.readwise.io/read/01jnx1ypbevhfvgnjznpnsf8f1)) --- When we enter a domain name in our browser, the computer needs to find the corresponding IP address. This process is known as `DNS resolution` or `domain translation`. The steps below show how this process works. | Step | Description | | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Step 1` | We type `www.example.com` into our browser. | | `Step 2` | Our computer checks its local DNS cache (a small storage area) to see if it already knows the IP address. | | `Step 3` | If not found locally, it queries a `recursive DNS server`. This is often provided by our Internet Service Provider or a third-party DNS service like Google DNS. | | `Step 4` | The recursive DNS server contacts a `root server`, which points it to the appropriate `TLD name server` (such as the `.com` domains, for instance). | | `Step 5` | The TLD name server directs the query to the `authoritative name server` for `example.com`. | | `Step 6` | The authoritative name server responds with the IP address for `www.example.com`. | | `Step 7` | The recursive server returns this IP address to your computer, which can then connect to the website’s server directly. | ([View Highlight](https://read.readwise.io/read/01jnx202bn48je2k26r73zj0jm)) ---