# TRY\_HACK\_ME : DNS

DNS, or Domain Name System, is like the internet’s phone book. It translates user-friendly web addresses (like [www.google.com](http://www.example.com/)) into computer-friendly IP addresses that help devices find each other on the internet.

<figure><img src="https://3821730555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCJMPuCQbMwIYqUJNCa28%2Fuploads%2F2mUD02wYLIbu2AJgbBGa%2FScreenshot%202024-02-19%20at%202.49.56%E2%80%AFPM.png?alt=media&#x26;token=2b5575b9-9cd0-41a5-b6c6-04532660bfbc" alt=""><figcaption></figcaption></figure>

\
**DOMAIN HIERARCHY:**

**TLD (Top-Level Domain)**:Most right-hand part of a domain name (e.g., .com).\
\
**Second-Level Domain:**&#x54;he part to the left of the TLD (e.g., tryhackme in tryhackme.com), limited to 63 characters.

**Subdomain:** Sits on the left side of the Second-Level Domain (e.g., admin in admin.tryhackme.com), created with the same restrictions, and can be used to create longer names like jupiter.servers.tryhackme.com; no limit to the number of subdomains.

What is the maximum length of a subdomain? 63

Which of the following characters cannot be used in a subdomain ( 3 b \_ — )? \_

What is the maximum length of a domain name? 253

### RECORD TYPES: <a href="#id-47e6" id="id-47e6"></a>

**Record**: Resolves to IPv4 addresses (e.g., 104.26.10.229).

**AAAA** **Record**: Resolves to IPv6 addresses (e.g., 2606:4700:20::681a:be5).

**CNAME** **Record**:Resolves to another domain name, like store.tryhackme.com pointing to shops.shopify.com.

**MX** **Record**: Resolves to email server addresses, with priority flags for server order (e.g., alt1.aspmx.l.google.com).

**TXT** **Record**:Stores text-based data, used for various purposes like listing authorized email servers or verifying domain ownership.

### **DNS REQUEST:** <a href="#e06a" id="e06a"></a>

1\. User Input: User types a web address into the browser (e.g., [www.tryhackme.com](http://www.tryhackme.com/)).\
\
2\. DNS Query:The browser sends a DNS query to a DNS resolver, asking for the IP address of the entered domain.

3\. DNS Resolution:The DNS resolver checks its cache for the IP. If not found, it queries authoritative DNS servers, starting from the root and moving down to the specific domain.

4\. Response: The authoritative DNS server replies with the IP address, and the resolver stores it in its cache for future use.

5\. Page Load:The browser now uses the obtained IP address to connect to the web server, loading the requested page ([www.tryhackme.com](http://www.tryhackme.com/)).

<figure><img src="https://3821730555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCJMPuCQbMwIYqUJNCa28%2Fuploads%2Fx6n2idCIfUZhmRP5oQxS%2FScreenshot%202024-02-19%20at%2010.36.57%E2%80%AFPM.png?alt=media&#x26;token=0555aee4-c56b-4e8c-a4f3-e82a0e916520" alt=""><figcaption></figcaption></figure>
