<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ dns - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ dns - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sat, 23 May 2026 22:20:40 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/dns/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How DNS Works: A Guide to Understanding the Internet's Address Book ]]>
                </title>
                <description>
                    <![CDATA[ The Domain Name System (DNS) translates domain names (like example.com) into IP addresses (like 192.0.2.1) so we can easily access websites. In this guide, you’ll learn how DNS resolution starts, its step-by-step process, how caching works, and the r... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-dns-works-the-internets-address-book/</link>
                <guid isPermaLink="false">6824f1ac04a60b4a58654ddc</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns resolver ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Domain Name System ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns server ]]>
                    </category>
                
                    <category>
                        <![CDATA[ internet ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Dhruv Prajapati ]]>
                </dc:creator>
                <pubDate>Wed, 14 May 2025 19:40:28 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1747235471002/8fbe4d7e-f1cb-4faf-a6a5-8dcaf38d58f3.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>The Domain Name System (DNS) translates domain names (like <code>example.com</code>) into IP addresses (like <code>192.0.2.1</code>) so we can easily access websites. In this guide, you’ll learn how DNS resolution starts, its step-by-step process, how caching works, and the role of root, TLD, and authoritative name servers.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-table-of-contents">Table of Contents</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-the-dns-resolution-process">The DNS Resolution Process</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-finding-the-first-dns-server-defaults-dhcp-and-manual-settings">Finding the First DNS Server: Defaults, DHCP, and Manual Settings</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-dns-resolution-powers-your-applications-network-requests">How DNS Resolution Powers Your Application’s Network Requests</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-1-valid-ip-check">Valid IP Check</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-2-application-cache-lookup">Application Cache Lookup</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-3-operating-system-cache-check">Operating System Cache Check</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-4-forwarding-to-configured-dns-server">Forwarding to Configured DNS Server</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-5-recursive-resolution-across-servers">Recursive Resolution Across Servers</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-understanding-the-role-of-the-recursive-resolver">Understanding the Role of the Recursive Resolver</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-recursive-resolver-and-root-name-server-interaction">Recursive Resolver and Root Name Server Interaction</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-recursive-resolver-and-tld-server-interaction">Recursive Resolver and TLD Server Interaction</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-recursive-resolver-and-authoritative-name-server-interaction">Recursive Resolver and Authoritative Name Server Interaction</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-domain-registrars-and-dns-setup-for-new-domains">Domain Registrars and DNS Setup for New Domains</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-what-are-domain-registrars">What Are Domain Registrars?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-what-happens-in-the-dns-system-when-you-buy-a-new-domain">What Happens in the DNS System When You Buy a New Domain?</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-the-dns-resolution-process">The DNS Resolution Process</h2>
<p>When you type a domain name like <code>example.com</code> into your browser, it loads the website almost instantly. So how does it do this?</p>
<p>Well, DNS resolution makes it happen, acting like the internet’s GPS to turn that name into an IP address (such as <code>192.0.2.1</code>) that computers use to find servers.</p>
<p>DNS resolution works by sending a query through a chain of DNS servers, each one helping to pinpoint the exact address. This process starts with a crucial step: your device needs to know which DNS server to contact first, either one set automatically or one chosen for speed and reliability.</p>
<h2 id="heading-finding-the-first-dns-server-defaults-dhcp-and-manual-settings">Finding the First DNS Server: Defaults, DHCP, and Manual Settings</h2>
<p>For DNS to function, a device must know the IP address of at least one DNS server. This is achieved through <strong>preconfigured settings</strong>, <strong>automatic configuration via DHCP</strong>, and <strong>manual configuration</strong>.</p>
<p>Devices like routers, smartphones, and computers often ship with hardcoded DNS server IPs. Common examples include Google Public DNS (<code>8.8.8.8</code>, <code>8.8.4.4</code>) and Cloudflare DNS (<code>1.1.1.1</code>). These serve as default starting points for DNS queries.</p>
<p>Also, when a device connects to a network (for example, home Wi-Fi), a Dynamic Host Configuration Protocol (DHCP) server – typically on the router – assigns an IP address and DNS server addresses. These are often provided by the Internet Service Provider (ISP), such as Comcast’s <code>75.75.75.75</code>, but can be overridden with alternatives like OpenDNS (<code>208.67.222.222</code>) or Quad9 (<code>9.9.9.9</code>).</p>
<p>Advanced users can manually specify DNS servers. Public DNS providers use memorable IP addresses for simplicity, such as Google’s <code>8.8.8.8</code> (repeating digits), Cloudflare’s <code>1.1.1.1</code> (short sequence), or Quad9’s <code>9.9.9.9</code> (repeating digits).</p>
<p>This design ensures seamless operation for most users, with DHCP and default configurations, while allowing power users to choose faster or privacy-focused DNS services.</p>
<h2 id="heading-how-dns-resolution-powers-your-applications-network-requests">How DNS Resolution Powers Your Application’s Network Requests</h2>
<p>When an application, like a web browser or a backend service, wants to make a network call – such as an HTTP request to load a webpage, a gRPC call for microservice communication, or an API fetch to retrieve data – it triggers a series of checks and queries to translate a domain name into an IP address. This process is designed for efficiency, leveraging caches and a distributed network of servers to handle the internet’s massive scale.</p>
<h3 id="heading-1-valid-ip-check"><strong>1. Valid IP Check</strong></h3>
<p>The process begins by checking if the destination address is already a valid IP address, like <code>192.168.1.1</code>. The system uses a regex check to confirm this. If it’s a valid IP, no DNS resolution is needed, and the network call proceeds directly.</p>
<p><strong>Note</strong> that in rare cases, DNS resolution is skipped entirely if an IP address is used directly. For example, a user might manually type an IP, like 192.0.2.1, into a browser instead of a domain name, though this is unlikely since IP addresses are hard to remember compared to names like example.com.</p>
<p>Similarly, some applications make network calls using IP addresses directly, bypassing the need for DNS. While possible, these scenarios are uncommon due to the convenience of human-readable domain names.</p>
<h3 id="heading-2-application-cache-lookup"><strong>2. Application Cache Lookup</strong></h3>
<p>If the destination address is a domain name, such as <code>example.com</code>, the application checks its own DNS cache, if it has one.</p>
<p>Modern browsers like Chrome and Firefox maintain built-in caches to speed up browsing. If the domain-to-IP mapping is found here, the process stops, and the IP is used for the network call.</p>
<h3 id="heading-3-operating-system-cache-check"><strong>3. Operating System Cache Check</strong></h3>
<p>If the application cache lacks the mapping or the application doesn’t have a caching mechanism at all, the request moves to the operating system’s DNS client, also known as the Local Resolver.</p>
<p>This varies by OS:</p>
<ul>
<li><p>Windows uses <a target="_blank" href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn593685\(v=ws.11\)">dnscache</a></p>
</li>
<li><p>macOS uses <a target="_blank" href="https://manp.gs/mac/8/mDNSResponder">mDNSResponder</a></p>
</li>
<li><p>Linux uses the <a target="_blank" href="https://www.man7.org/linux/man-pages/man5/nsswitch.conf.5.html">Name Switch Service</a></p>
</li>
</ul>
<p>The DNS client checks two places: the OS-level DNS cache, which stores recent domain-to-IP mappings, and the hosts file, a local file that manually maps domains to IPs (for example, <code>127.0.0.1 localhost</code>). If the mapping is found in either place, the process stops here.</p>
<h3 id="heading-4-forwarding-to-configured-dns-server"><strong>4. Forwarding to Configured DNS Server</strong></h3>
<p>If the mapping remains unresolved, the DNS client sends the query to a configured DNS server, such as the ISP’s server or a public one like Google DNS (<code>8.8.8.8</code>) or Cloudflare DNS (<code>1.1.1.1</code>). This server is a complex system with its own caches and a Recursive Resolver Service, like <a target="_blank" href="https://www.isc.org/bind/">BIND</a> or <a target="_blank" href="https://www.nlnetlabs.nl/projects/unbound/about/#:~:text=Unbound%20is%20a%20validating%2C%20recursive%2C%20caching%20DNS%20resolver.,DNS-over-HTTPS%20which%20allows%20clients%20to%20encrypt%20their%20communication.">Unbound</a>, which takes over the query.</p>
<h4 id="heading-caching-techniques">Caching techniques</h4>
<p>Caching, especially in recursive resolvers, stores query results to minimize redundant lookups and speed up responses for users:</p>
<ul>
<li><p><strong>Recursive resolver cache</strong>: Stores query results from root, TLD, and authoritative name servers in recursive resolvers to speed up responses.</p>
</li>
<li><p><strong>Negative cache</strong>: Stores responses for non-existent domains or records to avoid repeated queries.</p>
</li>
<li><p><strong>Forwarded query cache</strong>: Stores responses from queries forwarded to other resolvers or DNS servers to enhance performance.</p>
</li>
</ul>
<p>These caching mechanisms minimize external lookups (<a target="_blank" href="https://datatracker.ietf.org/doc/html/rfc1035">RFC 1035</a>).</p>
<h3 id="heading-5-recursive-resolution-across-servers"><strong>5. Recursive Resolution Across Servers</strong></h3>
<p>The recursive resolver, a core component of a DNS server, is responsible for performing recursive resolution to translate domain names like <code>example.com</code> into IP addresses.</p>
<p>As DNS records are distributed across multiple servers, the resolver parses the domain and executes a series of queries:</p>
<ol>
<li><p>It contacts a root name server, which directs it to the top-level domain (TLD) server (for example, for .com).</p>
</li>
<li><p>The TLD server points to the authoritative name server for the specific domain.</p>
</li>
<li><p>The authoritative server provides the final IP address.</p>
</li>
</ol>
<p>This distributed approach ensures scalability and reliability (<a target="_blank" href="https://datatracker.ietf.org/doc/html/rfc1035">RFC 1035</a>).</p>
<h2 id="heading-understanding-the-role-of-the-recursive-resolver">Understanding the Role of the Recursive Resolver</h2>
<p>The recursive resolver is the engine behind DNS resolution, working to convert a domain name like example.com into an IP address. Its journey begins by querying a root name server, the first step in navigating the DNS hierarchy to find the correct address.</p>
<h3 id="heading-recursive-resolver-and-root-name-server-interaction">Recursive Resolver and Root Name Server Interaction</h3>
<p>To understand this interaction, let’s first explore what root name servers are and their role in DNS.</p>
<h4 id="heading-exploring-root-name-servers">Exploring Root Name Servers</h4>
<p>Root name servers form the foundation of the DNS hierarchy, responding to queries for top-level domain (TLD) records to initiate resolution. They direct recursive resolvers to TLD servers, enabling the lookup of domain IP addresses.</p>
<ul>
<li><p>There are <strong>13 root server clusters</strong>, named a.root-servers.net to m.root-servers.net, operated by 12 organizations (VeriSign manages two). These clusters distribute global DNS query loads. As of May 10, 2025, 1,936 anycast instances ensure high availability and scalability, handling billions of daily queries (Root Server Technical Operations Association).</p>
</li>
<li><p>Each cluster uses <strong>anycast routing</strong>, sharing a single IP address across multiple global servers. Queries are routed to the nearest or least-loaded instance, reducing latency, enhancing reliability, and providing redundancy if a server fails.</p>
</li>
<li><p>The <strong>root hints file</strong>, provided by ICANN (<a target="_blank" href="https://www.iana.org/domains/root/files">IANA</a>), lists root server IP addresses and is preloaded in resolvers. It enables initial DNS queries without needing to resolve root server domains, preventing circular dependencies and ensuring system stability.</p>
</li>
</ul>
<p>The DNS began with just two root name servers in 1983. As the internet grew, more servers were added to meet demand. By 2002, the number reached 13, and anycast routing was proposed, allowing multiple servers to operate as a single cluster under one IP address.</p>
<p>Since then, the DNS has scaled by expanding these 13 clusters to handle global requirements (<a target="_blank" href="https://datatracker.ietf.org/doc/html/rfc882">RFC 882</a>, <a target="_blank" href="https://www.netnod.se/">Netnod</a>). For a detailed history, see the <a target="_blank" href="https://dnsinstitute.com/dns-history/dns-root-hints-history/">DNS Institute’s archive</a> and <a target="_blank" href="https://icannwiki.org/History_of_ROOT-SERVERS">History of ROOT-SERVERS</a>..</p>
<h4 id="heading-how-recursive-resolvers-query-root-name-servers">How Recursive Resolvers Query Root Name Servers</h4>
<p>The recursive resolver initiates resolution by querying a root name server for TLD records, relying on several mechanisms to ensure accuracy and efficiency.</p>
<ul>
<li>It uses the <strong>root hints file</strong>, ICANN’s list of root server IP addresses hardcoded in resolvers (for example, BIND), to avoid circular dependencies.</li>
</ul>
<ul>
<li><p><strong>Priming queries</strong> fetch updated root server IPs on resolver startup or cache expiry, ensuring reliability (RFC 8109).</p>
</li>
<li><p>The <strong>root zone file</strong>, ICANN’s database of TLDs and their name servers, is used by root servers to respond with TLD details (<a target="_blank" href="https://www.iana.org/domains/root/files">IANA</a>).</p>
</li>
</ul>
<p>When querying, the resolver selects a root server and requests TLD records (for example, for <code>.com</code>). The response includes <strong>NS</strong> records (for example, <code>a.gtld-servers.net</code> for <code>.com</code>) and <strong>glue records</strong>, which are IP address records (<strong>A</strong> or <strong>AAAA</strong>) providing the TLD name servers’ IPs directly.</p>
<p>Glue records are critical when the requested name servers’ domains are within the queried domain (for example, <code>ns1.example.com</code> for <code>example.com</code>), preventing circular dependency by supplying the IP without resolving the domain.</p>
<p>For TLD queries, glue records are always included, speeding up resolution by avoiding additional lookups for TLD name server domains like <code>a.gtld-servers.net</code>, especially for busy TLDs like <code>.com</code> (<a target="_blank" href="https://datatracker.ietf.org/doc/html/rfc1035">RFC 1035</a>).</p>
<h3 id="heading-recursive-resolver-and-tld-server-interaction">Recursive Resolver and TLD Server Interaction</h3>
<p>Once the recursive resolver receives the root server’s response, including glue records, it queries a TLD name server (for example, <code>a.gtld-servers.net</code> for <code>.com</code>). TLD name servers maintain <strong>zone files</strong> listing domains under their TLD (for example, <code>example.com</code>) and their name servers.</p>
<p>The TLD server responds with a referral, providing the authoritative name server records (for example, <code>ns1.example.com</code> for <code>example.com</code>). If the authoritative server’s domain is within the requested domain (for example, <code>ns1.example.com</code>), glue records are included to provide the IP directly, preventing circular dependency.</p>
<p>The resolver caches the response based on its TTL to speed up future queries. If the TLD server is unreachable, the resolver tries another TLD server from the root’s response (<a target="_blank" href="https://datatracker.ietf.org/doc/html/rfc1035">RFC 1035</a>).</p>
<h3 id="heading-recursive-resolver-and-authoritative-name-server-interaction">Recursive Resolver and Authoritative Name Server Interaction</h3>
<ul>
<li><p>The recursive resolver then queries the authoritative name server (for example, <code>ns1.example.com</code>), which maintains zone files with DNS records like <strong>A</strong>, <strong>CNAME</strong>, or <strong>MX</strong> for its domain (for example, <code>example.com</code>).</p>
</li>
<li><p>The server returns the requested record, such as an A record (for example, <code>192.0.2.1</code>), AAAA, CNAME, or MX, depending on the query.</p>
</li>
<li><p>Glue records from the TLD response provide the server’s IP if within the domain, avoiding circular dependency.</p>
</li>
<li><p>The resolver caches the response based on TTL for efficiency. In rare cases, the server may delegate to another authoritative server (for example, for subdomains), requiring further queries. If unreachable, the resolver tries another authoritative server (<a target="_blank" href="https://datatracker.ietf.org/doc/html/rfc1035">RFC 1035</a>).</p>
</li>
</ul>
<p>Traditionally, zone files for Root, TLD, and Authoritative name servers were text files listing domains and their DNS records, guiding queries across the DNS hierarchy.</p>
<p>Modern DNS infrastructure has replaced these with efficient databases or in-memory databases, using optimized data structures like hash tables or tries for faster lookups and scalability. This shift supports the growing number of TLDs and high query volumes across all server types.</p>
<p>Similarly, the anycast routing proposal, introduced to enhance speed and reliability by distributing server instances globally, was designed for all name servers – Root, TLD, and Authoritative.</p>
<p>While root name servers universally adopt anycast, ensuring low latency and redundancy, not all TLD and authoritative name servers strictly follow it.</p>
<p>Some TLDs and smaller authoritative servers rely on unicast or limited anycast due to cost or operational constraints, leading to varied performance across the DNS hierarchy.</p>
<p>The following diagram illustrates the complete Domain Name Resolution process, summarizing the steps outlined above.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746995157651/f0f9913b-a23a-4654-bea5-c9d8a8e4f7ca.png" alt="DNS Resolution System Diagram" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>The following image shows the <code>dig +trace google.com</code> output, demonstrating the resolution process from root to authoritative name servers:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1747000331356/8735cac3-5a22-48c2-9691-62ed6d8fb885.png" alt="DNS Resolution Process in Action using dig tool" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<h2 id="heading-domain-registrars-and-dns-setup-for-new-domains">Domain Registrars and DNS Setup for New Domains</h2>
<h3 id="heading-what-are-domain-registrars">What Are Domain Registrars?</h3>
<p>Domain registrars were originally established to manage the registration of domain names, allowing individuals and organizations to secure unique names (for example, <code>example.com</code>) for websites and online services. They act as intermediaries between domain owners and domain registries, which maintain the authoritative databases for top-level domains (TLDs) like <code>.com</code> or <code>.org</code>.</p>
<p>Registrars handle tasks such as registering domains, renewing them, and updating DNS settings, ensuring seamless integration with the global DNS system. Many registrars also offer additional services like web hosting and SSL certificates to support website operations.</p>
<p>GoDaddy and Hostinger are among many registrars, known for their user-friendly platforms and comprehensive service offerings.</p>
<h3 id="heading-what-happens-in-the-dns-system-when-you-buy-a-new-domain">What Happens in the DNS System When You Buy a New Domain?</h3>
<p>When you purchase a new domain (like <code>example.com</code>) through a registrar like GoDaddy or Hostinger, the following steps occur in the DNS system:</p>
<ul>
<li><p><strong>Step 1: Registration with the registry</strong> – The registrar sends your domain details to the registry for the TLD (for example, VeriSign for <code>.com</code>). The registry adds the domain to its database, recording the registrar as the managing entity and the authoritative name servers (for example, <code>ns1.example.com</code>) you specify.</p>
</li>
<li><p><strong>Step 2: Name server configuration</strong> – You configure the domain’s name servers at the registrar’s control panel (for example, GoDaddy’s Domain Portfolio or Hostinger’s hPanel). These name servers, often provided by the registrar or hosting provider (for example, <code>ns1.hostinger.com</code>), point to the DNS zone file that contains DNS records for your domain.</p>
</li>
<li><p><strong>Step 3: DNS zone setup</strong> – The DNS zone file, managed where the name servers point, is updated with DNS records like:</p>
<ul>
<li><p><strong>A record</strong>: Maps the domain (for example, <code>example.com</code>) to the hosting server’s IP address (for example, <code>192.0.2.1</code>).</p>
</li>
<li><p><strong>CNAME record</strong>: Aliases subdomains (for example, <code>www.example.com</code>) to another domain.</p>
</li>
<li><p><strong>MX record</strong>: Directs email to mail servers.</p>
</li>
</ul>
</li>
</ul>
<p>    If using the registrar’s hosting, these records may be set automatically. Otherwise, you manually configure them to point to your hosting provider’s IP.</p>
<ul>
<li><p><strong>Step 4: DNS propagation</strong> – After updating name servers or DNS records, changes propagate across the global DNS network, which can take 24–48 hours due to caching and server updates. During this period, your website may not be immediately accessible.</p>
</li>
<li><p><strong>Step 5: TLD registry update</strong> – The registry updates its records to include the domain’s name servers, which are queried by recursive resolvers during DNS lookups. For domains with name servers in the same domain (for example, <code>ns1.example.com</code> for <code>example.com</code>), glue records (IP addresses of the name servers) are registered with the registry to prevent circular dependencies.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>The Domain Name System (DNS) translates domain names into IP addresses, making the internet user-friendly. It resolves queries efficiently through a hierarchical system and caching, evolving from a few root servers in 1983 to a scalable, anycast-driven network today.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is DNS? Basics for Beginners ]]>
                </title>
                <description>
                    <![CDATA[ When you access a website like www.google.com, would it surprise you to learn that the URL isn't really the website address?  There is some work "under the hood" to ensure that, when you type in a human friendly name like Google, it takes you to the ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-dns-for-beginners/</link>
                <guid isPermaLink="false">66bc55f9d94fa6cb67b84529</guid>
                
                    <category>
                        <![CDATA[ computer network ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kealan Parr ]]>
                </dc:creator>
                <pubDate>Tue, 25 Jul 2023 18:07:28 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/02/dns.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When you access a website like <a target="_blank" href="https://www.google.com/">www.google.com</a>, would it surprise you to learn that the URL isn't <em>really</em> the website address? </p>
<p>There is some work "under the hood" to ensure that, when you type in a human friendly name like Google, it takes you to the website you're expecting it to.  </p>
<p>So, what's happening under the hood?</p>
<h1 id="heading-what-are-urls">What are URLs?</h1>
<p>You may be familiar with what a URL is. It's a simple link to a bit of content on the web. People use URL's daily to share videos, pictures, sites, articles – almost anything on the internet.</p>
<p>URL is an acronym for <strong>Uniform Resource Locator,</strong> and we can break them down into multiple smaller "pieces". Here's what makes up a standard URL:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/02/image-264.png" alt="Image" width="600" height="400" loading="lazy">
<em>Anatomy of a URL showing the Scheme, Domain Name, Path, and Parameters</em></p>
<p>A <strong>URL</strong> is just an address for a resource. The resources differ like we discussed, but they're just pointers all over the internet to take you to content you want to view.</p>
<p>As you can see in the graphic above, the breakdown of a URL is often:</p>
<ul>
<li><strong>Scheme:</strong> this is the protocol a browser uses to access your content. Normally for websites it's HTTP (insecure), or HTTPS (secure).</li>
<li><strong>Domain name:</strong> the website name ("www.google.com" here)</li>
<li><strong>Port:</strong> a network <a target="_blank" href="https://en.wikipedia.org/wiki/Port_(computer_networking)">port</a> (80 in this example)</li>
<li><strong>Path:</strong> a path to a particular resource on the server</li>
<li><strong>Parameters:</strong> often key-value pairs, to serve extra data to the web server.</li>
</ul>
<h1 id="heading-what-are-ip-addresses">What are IP Addresses?</h1>
<p>Humans and computers navigate the web very differently. Whilst most humans use <strong>URL's</strong> like we just discussed, to communicate between computers, computers use the <strong>Internet Protocol</strong> <strong>(IP).</strong> </p>
<p>The <strong>IP</strong> is a set of rules that route and address data packets (all the data you want to view) to make sure it arrives to your computer.</p>
<p>The Internet Protocol relies on devices and domains, all having their own <strong>IP address</strong> to connect and identify all the different segments (packets!) of the internet. </p>
<p>An <strong>IP address</strong> is a series of standardised numbers that range from 0 to 255 – separated by dots. </p>
<p>If you want to see <strong>IP addresses</strong> in action, and are familiar with terminals, you can type <code>ping google.com</code> in whichever terminal you like and you can see the <strong>IP address</strong> of Google.com.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/03/image-56.png" alt="Image" width="600" height="400" loading="lazy">
<em>A screenshot from a PowerShell terminal, showing a ping command to 216.58.212.206, and 0% packet loss.</em></p>
<p>You can test this further by typing <strong>216.58.212.206</strong> directly into your browser and seeing if it takes you to Google. </p>
<p>Hopefully this small example highlights why we use <strong>URL's</strong>. If both addresses (<strong>IP address</strong> and <strong>domain name</strong>) took you to the same place, would you rather be asked to remember <strong>Google.com</strong> or <strong>216.58.212.206</strong>?</p>
<p>Note that some IP addresses change day to day (called <a target="_blank" href="https://support.opendns.com/hc/en-us/articles/227987827-What-is-a-Dynamic-IP-Address-">dynamic IP addresses</a>) – so the above <strong>IP address</strong> may not work, depending on if the IP address is dynamic or static.</p>
<p>Static IP addresses are ones that don't change – but to assign a single <strong>IP address</strong> to every machine would be impractical. It would be a logistical nightmare, too, as some people only log onto computers once a month to send an email, for example. </p>
<p>We could very realistically run out of IP addresses on today's current technology if we gave every device a unique <strong>IP address</strong> (if you want to read how IP addresses are allocated in greater detail, <a target="_blank" href="https://www.freecodecamp.org/news/ipv4-vs-ipv6-what-is-the-difference-between-ip-addressing-schemes/">read here</a>).</p>
<h1 id="heading-what-is-a-dns">What is a DNS?</h1>
<p>If we know computers communicate via the <strong>Internet Protocol</strong> and communicate using <strong>IP Addresses</strong>, how do we turn <a target="_blank" href="https://www.freecodecamp.org/news/p/addfad35-db16-4e8d-abf6-c36009bd5bca/www.google.com">google.com</a> into the website we use so regularly?</p>
<p>The answer is using a <strong>Domain Name System (DNS)</strong>. The job of the Domain Name System is to transform human readable <strong>domain names</strong> into <strong>IP addresses</strong>.</p>
<p>There are four servers specifically that we'll discuss.</p>
<h2 id="heading-dns-recursor">DNS Recursor</h2>
<p>A <strong>DNS Recursor</strong> is like a waiter in a restaurant. It acts like a "front facing" part of the system to receive orders (normally from browsers) where the waiter then heads into the back to get what is needed.</p>
<p>In reality, it's just a server that receives <strong>DNS queries</strong> from browsers and returns information.</p>
<p>There are 3 different places the DNS recursor can generally get the information from depending on if any data has been cached:</p>
<ul>
<li>Root nameserver</li>
<li>TLD nameserver</li>
<li>Authoritative nameserver</li>
</ul>
<p>So let's discuss them one by one.</p>
<h3 id="heading-what-is-a-root-nameserver">What is a Root Nameserver?</h3>
<p>The root nameserver's main job is to return the <strong>Top-Level Domain (TLD) server</strong>.  <em>**</em>  </p>
<p>This is an important step to map hostnames into IP addresses.</p>
<p>The root nameserver essentially acts like a catalogue that points to more specific locations.</p>
<h3 id="heading-what-is-a-top-level-domain-tld-server">What is a Top-Level Domain (TLD) Server?</h3>
<p>If the root nameserver acts like a catalogue, the <strong>TLD server</strong> acts like a page in a catalogue.</p>
<p>The TLD server generally returns the final part of the host-name, like <strong>com</strong> for example, in "google.com".</p>
<h3 id="heading-what-is-an-authoritative-nameserver">What is an Authoritative Nameserver?</h3>
<p>This server is like a row entry on the specific page of the catalogue.</p>
<p>The <strong>authoritative nameserver</strong> now can return the IP address for the requested hostname from the browser, back to the DNS recursor – which can hand it back to the browser.</p>
<p>DNS can be super confusing, and to understand the whole process may take a little while, so let's tie it together with a final example.    </p>
<h2 id="heading-example-request">Example Request</h2>
<p>Let's break down an example request from a user, and hopefully tie together this pretty complex process.</p>
<p>Each step in the flow starts to point closer and closer to the final address the user will eventually end up hitting.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-168.png" alt="Image" width="600" height="400" loading="lazy">
<em>Diagram showing the steps in the request process</em></p>
<p>Let's break down what's going on in this graphic:</p>
<h3 id="heading-step-1">Step 1:</h3>
<p>A user types 'kealanparr.com' into their browser, and the query hits the DNS recursor.</p>
<h3 id="heading-step-2">Step 2:</h3>
<p>The DNS recursor then queries a Root nameserver</p>
<h3 id="heading-step-3">Step 3:</h3>
<p>The Root nameserver then responds to the DNS recursor with the address of a Top Level Domain server (TLD) such as .com. </p>
<h3 id="heading-step-4">Step 4:</h3>
<p>The DNS recursor then makes a request to the .com TLD.</p>
<h3 id="heading-step-5">Step 5:</h3>
<p>The .com TLD server then responds with the IP address of the Domain’s nameserver, kealanparr.com.</p>
<h3 id="heading-step-6">Step 6:</h3>
<p>The DNS recursor sends a query to the domain’s nameserver.</p>
<h3 id="heading-step-7">Step 7:</h3>
<p>The IP address for kealanparr.com is then returned to the resolver from the Domain nameserver.</p>
<h3 id="heading-step-8">Step 8:</h3>
<p>The DNS recursor responds to the web browser request with the IP address of the domain requested.</p>
<h3 id="heading-step-9">Step 9:</h3>
<p>At this point, the DNS lookup has returned enough data for the browser to make the request for the web page.</p>
<ul>
<li>The browser makes a HTTP request to the IP address.</li>
<li>The server at that IP returns the webpage content to be rendered in the browser.</li>
</ul>
<h1 id="heading-conclusion">Conclusion</h1>
<p>I hope this article has helped you to understand a few networking principles that affect the websites you use everyday. </p>
<p>IP addresses, DNS, and more are all technologies most people use daily but may not be very familiar with.</p>
<p>Cloudflare has an article that was helpful as I researched for this article, which you can read <a target="_blank" href="https://www.cloudflare.com/en-gb/learning/dns/what-is-dns/">here</a>.</p>
<p>I tweet my articles <a target="_blank" href="https://twitter.com/kealanparr">here</a> if you would like to read more.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ DNS Server Not Responding – How to Fix the Error in Windows 10 ]]>
                </title>
                <description>
                    <![CDATA[ I think it's safe to say that the vast majority of professionals depend on the internet these days.  So being denied access to the internet when you are trying to mine nuggets of valuable information from your go-to web sites can be quite an ordeal. ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-fix-dns-server-not-responding-error-windows-10/</link>
                <guid isPermaLink="false">66b0c5886e47f92ed2d0bf25</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ error ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows 10 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Gavin Lon ]]>
                </dc:creator>
                <pubDate>Fri, 30 Sep 2022 15:00:47 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/09/DNS-Issue-Main-Pic---pexels-yan-krukov-4458420.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>I think it's safe to say that the vast majority of professionals depend on the internet these days. </p>
<p>So being denied access to the internet when you are trying to mine nuggets of valuable information from your go-to web sites can be quite an ordeal. Especially when you are under pressure to complete a piece of urgently required work. </p>
<p>One particularly unwelcome cause of being denied access to the internet is the “DNS Server Not Responding” error. It’s like that old fable where a troll sits under a bridge and says “You shall not pass!”, or something about gobbling up those that wish to cross the bridge. </p>
<p>I’m happy to tell you that you should be able to defeat the troll and cross the bridge to internet access joy by following the simple trouble shooting steps discussed in this article.</p>
<h2 id="heading-what-is-the-dns-server-not-responding-error">What is the "DNS Server Not Responding" Error?</h2>
<p>The “DNS Server Not Responding” error is a fairly common issue and is generally easy to fix. There are many reasons why this issue may occur. But fundamentally it is caused because the DNS server that is contacted during the processes of loading a web page is unable to find the site that contains the web page that you have requested. </p>
<p>This article explores what may have triggered this issue to occur and how you may go about fixing the issue.</p>
<p>Firstly, I think it is a good idea to gain at least a basic understanding of the “DNS Server Not Responding” error. To do this, let’s first understand DNS. </p>
<p>DNS stands for Domain Name System. A simple explanation of DNS is that it is a decentralised storage of human readable internet addresses, like the ones with which you will almost certainly be familiar (for example www.amazon.com or www.netlix.com). </p>
<p>The DNS maps these human readable URLs to their appropriate IP (Internet Protocol) addresses. </p>
<p>IP addresses are much less human readable, but are essential for the inner workings of the internet. IP addresses uniquely identify computers on the internet. The IP address associated with the URL, www.netflix.com, might for example, look like this, 69.53.224.255. </p>
<p>It is clearly easier for you to remember “<a target="_blank" href="http://www.netflix.com">www.netflix.com</a>", rather than a string of numbers delimited by full stops, when you wish to access your favourite content on Netflix. So the DNS facilitates this for you, so that you don’t have to remember or manually lookup unfriendly strings of numeric data every time you wish to access a web site. </p>
<p>The common analogy to explain DSN is a telephone directory. Basically, as you would look up a telephone number using the name of the person you wish to call in a telephone directory, a similar look up is performed when you type in the URL (like www.amazon.com) of the web site you wish to view within your browser.</p>
<p>Thankfully you don’t have to manually look up the corresponding IP address for www.amazon.com, as this is performed behind the scenes for you automatically. </p>
<p>So the appropriate IP address is retrieved automatically every time you type in a URL into your browser. This IP address is then used to contact the appropriate server that hosts the relevant web site associated with the URL you have entered into your browser.</p>
<p>When the “DNS Server Not Responding” error occurs, this means that the decentralised naming systems responsible for automatically looking up the appropriate IP address based on the relevant hostname that you entered into you browser fails to respond. </p>
<p>There are many reasons why this error occurs, but fortunately there are also many solutions available to you to fix the issue. </p>
<p>An easy solution may be to simply change the web browser you are using or even simpler still, simply restart your computer. Yup, simply turning it off and then turning it on again could fix the issue. </p>
<p>However, if you are not so lucky and the problem still persists, don’t despair – there are many steps that you can take to find out the cause of the issue and subsequently fix it. </p>
<p>In this article you will learn a number of possible solutions to the “DNS Server Not Responding” error.</p>
<h2 id="heading-how-to-fix-dns-serger-not-responding">How to Fix "DNS Serger Not Responding"</h2>
<p>Below, I've listed out the ways that you can try using to fix the “DNS Server Not Responding” error. The subsequent sections of this article provide details on each of these methods:</p>
<ul>
<li>Use a Different Web Browser</li>
<li>Try Accessing a Web Site with a Different Device</li>
<li>Restart your Router</li>
<li>Investigate Possible Network Issues</li>
<li>Manually Set your DNS Server</li>
<li>Clear the DNS Cache</li>
<li>Disable Internet Protocol Version 6</li>
<li>Temporarily Deactivate your Firewall and Disable your Antivirus Software</li>
<li>Reset your DNS Settings</li>
<li>Update the Network Adapter Driver</li>
<li>Disable all Network Connections Except the Connection you are Using to Access the Internet</li>
<li>Restart your Computer in Safe Mode</li>
</ul>
<h3 id="heading-use-a-different-web-browser">Use a Different Web Browser</h3>
<p>A potential solution to the “DNS Server not Responding” issue that's really simple is to try accessing the relevant website using a different browser. </p>
<p>If, for example, you are using Microsoft Edge or Mozilla Firefox as your browser at the time that the issue occurs, try using a different browser like Google Chrome to access the relevant website.</p>
<p>If using a different browser solves the problem, then make the browser that works your default browser. But if the issue still persists, then we at least know that the browser you have been using is not the source of the issue and our investigation into finding a solution to the DNS Server not Responding” issue must continue…</p>
<h3 id="heading-try-accessing-a-website-with-a-different-device">Try Accessing a Website With a Different Device</h3>
<p>Try to use a different device connected to your home network to access the website you were trying to access when you received the error. </p>
<p>For example, use Wi-Fi from your mobile phone to access the relevant web site. If the issue persists, you know that the issue isn’t just with your primary device and the problem may have something to do with your router.</p>
<h3 id="heading-restart-your-router">Restart Your Router</h3>
<p>The “DNS Server not Responding” issue may occur simply due to data traffic. It may be that simply restarting your router can fix this issue. </p>
<p>You can restart your router by pressing the power button on your router. You can then unplug your router's power cable. Wait for about 30 seconds then plug your router into the power outlet again and press the power button to restart it.</p>
<h3 id="heading-investigate-possible-network-issues">Investigate Possible Network Issues</h3>
<p>Running network diagnostics may point to network issues as the root cause of the issue. </p>
<p>Running Network Diagnostic is very simple on a Windows 10 OS. You can do this by following these steps:</p>
<ul>
<li>Open Control Panel. One way to do this is press the <strong>Windows Key + R</strong> to activate the “Run” box, then type “control” in the text box presented in the “Run” box and hit the enter key.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-443.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Select the <strong>Network and Internet</strong> option presented within the Control Panel window.</li>
<li>Click the <strong>Network and Sharing Center</strong> option from within the “Network and Internet” window.</li>
<li>Click the <strong>Troubleshoot problems</strong> option presented under the "Change your network settings” heading within the “Network and Sharing Center” window.</li>
<li>Click <strong>Additional troubleshooters</strong> -&gt; <strong>Internet Connections</strong> -&gt; <strong>Run the troubleshooter</strong></li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-457.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The next step is to wait for the troubleshooter task to finish. If you are presented with any error messages, simply follow the steps on how to fix the relevant network issue.</p>
<h3 id="heading-manually-set-your-dns-server">Manually Set Your DNS Server</h3>
<p>The source of your issue may be that your DNS server is down. In this case you’ll be pleased to know that you are able to manually change your DNS server. </p>
<p>You can change your DNS server to, for example, Googles Public DNS or CloudFlare’s public DNS. To change your DNS server, follow these steps:</p>
<ul>
<li>Invoke your Control Panel. One way to invoke your Control Panel is to activate your Start Menu and search for the Control Panel.</li>
<li>In the Control Panel window click the <strong>Network and Internet</strong> option.</li>
<li>In the <strong>Network and Internet</strong> window, click the <strong>Network and Sharing Center</strong> option.</li>
<li>On the  <strong>Network and Sharing Center</strong> window click on your active connection. For example, click the “ethernet” option if this is the connection currently being used or click the “Wi-Fi” option if it is clear that this is your active connection.</li>
<li>In the dialog box that is presented to you, click the “Properties” button.</li>
<li>In the dialog presented to you, you’ll see a list is presented under the “The connection uses the following items” heading.</li>
<li>In this list, select the list item labelled “Internet protocol version 4 (TCP/IPv4)” then click the “Properties” button.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-445.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>You will be presented with another dialog box where you’ll see two fields. One will be labelled “Preferred DNS Server”, and the other which is directly under this field will be labelled “Alternate DNS Server”.</li>
<li>First click the <strong>Use the following DNS server addresses</strong> radio button.</li>
<li>To use Googles Public DNS server, enter 8.8.8.8 in the field labelled “Preferred DNS Server” and enter 8.8.4.4 into the field labelled “Alternate DNS Server”.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-446.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>You are also able to use CloudFlare’s DNS server for the same purpose. CloudFlare’s DNS address is simply 1.1.1.1</li>
<li>Once you have entered your desired DNS server settings, ensure that the “Validate settings upon exit” checkbox is checked.</li>
<li>Click the “OK” button to save your new DNS server settings.</li>
<li>Restart your computer.</li>
</ul>
<h3 id="heading-clear-the-dns-cache">Clear the DNS Cache</h3>
<p>You are able to flush the DNS cache which may resolve the “DNS Server not Responding” issue. This action will clear IP addresses and other DNS related data from  your cache.</p>
<p>You can clear the DNS cache by running a command using your command prompt.</p>
<p>One way to invoke the command prompt is to press <strong>Window Key + R</strong> to invoke the “Run” box. Type “cmd” within the “Run” box and press <strong>shift+ctrl+enter</strong> to run the command prompt as an administrator.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-458.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>At the command prompt, type in the following command: “ipconfig /flushdns” and them press the enter key. If the command has executed successfully, you'll see the appropriate message in the command window.</p>
<h3 id="heading-disable-internet-protocol-version-6">Disable Internet Protocol Version 6</h3>
<p>At the time of writing this article, Internet Protocol Version 6 is the latest version of the internet protocol. Disabling the Internet Protocol Version 6 will not have detrimental effects on your computer’s operations, but it's been known to fix the “DNS Server not Responding” issue.</p>
<p>To disable the Internet Protocol version 6 on a Windows 10 operating system, just follow these steps:</p>
<ul>
<li>Go to <strong>Control Panel</strong> -&gt; <strong>Network and Internet</strong> -&gt; <strong>Network and Sharing Center</strong></li>
<li>Click on the relevant connection, for example “Wi-Fi”</li>
<li>Click the “Properties” button on the dialog that is presented to you.</li>
<li>In the list presented under the “This connection uses the following items” heading, uncheck the item labelled “Internet Protocol Version 6 (TCP/IPv6)”.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-448.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Press the “OK button”</li>
</ul>
<h3 id="heading-temporarily-deactivate-your-firewall-and-disable-antivirus">Temporarily Deactivate your Firewall and Disable Antivirus</h3>
<p>If your firewall is Defender, you can follow these steps to disable it:</p>
<ul>
<li>To open control panel, press <strong>Windows Key + R</strong> to activate the “Run” box, then type “control” in the text box presented in the “Run” box and hit the enter key.</li>
<li>In the top right hand text box, type in “win”</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-459.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>An option labelled "Windows Defender Firewall” should appear in the search results. Click the “Windows Defender Firewall” option.</li>
<li>Click the “Allow an app or feature through Windows Defender Firewall” option.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-462.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Click the “Change settings” button.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-461.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>From the list presented to you within the dialog box that has just been invoked, find the browser that you are using, for example Google Chrome. Then make sure that both the private and public checkboxes next to the relevant item are checked.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-466.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Once you've done this, try to access the relevant website using the relevant browser and see if the issue has been fixed.</li>
</ul>
<p>There is a chance that your firewall was preventing you from accessing external data through your browser. </p>
<p>Note that it is not recommended to leave your operating system unprotected by reliable antivirus software indefinitely. Disabling your antivirus software in this instance is only recommended for testing if the relevant antivirus software is the cause of the “DNS Server not Responding” issue. </p>
<p>To temporarily turn off Microsoft Defender antivirus protection, follow these steps:</p>
<ul>
<li>Select Start and then type in "Windows Security” in order to search for the relevant application.</li>
<li>Select <strong>Windows Security App</strong> from the search results.</li>
<li>Go to <strong>Virus &amp; Threat Protection</strong>.</li>
<li>Under <strong>Virus &amp; threat protection settings</strong> select <strong>Manage settings.</strong></li>
<li>Switch <strong>Real-time protection</strong> off.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-467.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Attempt to access the relevant website through the relevant browser to test if the “DNS Server not Responding” issue still occurs.</p>
<h3 id="heading-reset-dns-settings">Reset DNS Settings</h3>
<p>To reset your DNS Settings, follow these steps:</p>
<ul>
<li>Run the command prompt as an administrator. To do this activate the “Run” box by pressing <strong>Windows key + R</strong>.</li>
<li>In the run box type “cmd” and press <strong>shift + ctrl + enter</strong></li>
<li>Type the following commands in the command prompt. After entering each command press the enter key, so that each command is run individually.</li>
</ul>
<p><code>ipconfig /registerdns</code></p>
<p><code>ipconfig /release</code></p>
<p><code>Ipconfig /renew</code></p>
<p><code>netsh winsock reset</code></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-465.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Once you have run these commands, close the command prompt and restart your computer.</p>
<h3 id="heading-update-the-network-adapter-driver">Update the Network Adapter Driver</h3>
<p>You can manually update your network adapter driver, but it is much easier to automate this task. </p>
<p>You can automate this through the use of free software like “Driver Easy” (https://www.drivereasy.com/download-free-version/). Simply download the free version of this software. </p>
<p>Make sure that before you run the free version of the Driver Easy software that you create a system restore point. This provides you with insurance, so in the unlikely event that you encounter a nasty surprise that adversely effects your computer, that you are able to return your Windows OS back to the state that it was in before you ran the Driver Easy software and encountered an unexpected issue.</p>
<p>To use the Driver Easy software, follow these steps:</p>
<ul>
<li>Run the software</li>
<li>Click the “Scan Now” button</li>
<li>Press the “Update” button next to any outdated drivers.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-455.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-disable-all-network-connections-except-for-the-connection-that-you-are-using">Disable all Network Connections Except for the Connection that you are Using</h3>
<p>Disabling the additional network connections you may have setup on your computer (other than, for example, the Wi-Fi connection that you are using to access the internet) might fix the “DNS Server not Responding” issue. </p>
<p>To disable the relevant network connection, follow these steps:</p>
<ul>
<li>Firstly you must access your Network Connections. To access your Network Connections, press <strong>Windows Key + R</strong> to invoke the “Run” box</li>
<li>In the “Run” box type in “ncpa.cpl” and press enter.</li>
<li>Right click the relevant network connection and select “Disable” from the relevant context menu. Repeat this action until all connections except for the Wi-Fi connection you are using are disabled.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-456.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-restart-your-computer-in-safe-mode">Restart your Computer in Safe Mode</h3>
<p>When you start your computer in Safe Mode, this means the Windows operating system loads with a limited set of drivers and files. This can help you diagnose what is causing your “DNS Server not Responding” issue through a process of illumination (as it were). </p>
<p>So to start your PC in Safe Mode, follow these steps:</p>
<ul>
<li>Press the <strong>Windows Key + I</strong> to open Settings.</li>
<li>Select <strong>Update &amp; Security</strong> -&gt; <strong>Recovery</strong></li>
<li>Under <strong>Advanced startup</strong>, select <strong>Restart Now</strong></li>
<li>Once your PC has startup to the “Choose an option” screen, select <strong>Troubleshoot</strong> -&gt;  <strong>Advanced options</strong> -&gt; <strong>Startup Settings</strong> -&gt; <strong>Restart</strong></li>
<li>Once your PC has restarted you’ll see a list of options</li>
<li>Select <strong>5</strong> or press <strong>F5</strong> for Safe Mode with Networking.</li>
</ul>
<p>Try to access the web site that resulted in you getting the “DNS Server not Responding” issue. If the problem does not occur in safe mode this means that additional software may be the cause of the issue. </p>
<p>You can uninstall any additional software from your PC, one by one, and then test to see if the issue still occurs. If the issue does not occur after uninstalling particular software, this means that it is likely that this software was interfering with your internet access.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>The “DNS Server not Responding” issue is relatively common and thankfully it is also relatively easy to fix. </p>
<p>It can be incredibly inconvenient to be denied access to the internet but hopefully the potential solutions outlined in this article will help you to once again have access to your favorite web sites.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is ANAME? ANAME Record DNS Tutorial ]]>
                </title>
                <description>
                    <![CDATA[ If you’ve ever had to make a domain name work with a website, you’ve probably seen ANAME as some record – just like the popular Canonical name record type or simply CNAME. CNAME and ANAME are both solutions for pointing a hostname to your website. Fo... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-aname-aname-record-dns-tutorial/</link>
                <guid isPermaLink="false">66adf266db5636c0b30cbaa0</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ domain names ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Mon, 02 May 2022 18:02:19 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/alias-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you’ve ever had to make a domain name work with a website, you’ve probably seen ANAME as some record – just like the popular Canonical name record type or simply CNAME.</p>
<p>CNAME and ANAME are both solutions for pointing a hostname to your website. For example, <code>yourapp.netlify.com</code> to <code>yourwebsite.com</code>.</p>
<p>You’ve probably been using CNAME to make domain names point to websites. But instead, you can use an ANAME which has some added advantages because it gives you more flexibility.</p>
<p>In this article, you will learn what ANAME is, the advantages it has over CNAME, and when to use it.</p>
<h2 id="heading-what-is-aname">What is ANAME?</h2>
<p>ANAME, also called ALIAS, is a domain record type that can be used in place of a CNAME record. It's available from domain name companies such as Namecheap, GoDaddy, Hostinger, Google Domain, and more.</p>
<p>ANAME was born out of the combination of CNAME and another record type called A. So, ANAME is a CNAME and A record in one package.</p>
<p>ANAME is not a read DNS record but a way of simulating it. And that’s why it is called Alias name, or ANAME for short.</p>
<p>When you purchase a domain name and log in to its management panel, you will always see an option to use ANAME. </p>
<p>N.B.: Some domain name providers call it ALIAS instead of ANAME</p>
<p>Below is the Namecheap panel for managing domains and they call it ALIAS.
<img src="https://www.freecodecamp.org/news/content/images/2022/04/alias.png" alt="alias" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-does-aname-work">How Does ANAME Work?</h2>
<p>Just like CNAME, ANAME maps one domain name to another. So, an ANAME is configured to point to another domain. </p>
<p>When the domain name an ANAME points to is queried by the client browser, it responds with an IP address. A CNAME, on the other hand, cannot point to an IP address, but an ANAME can. This is one of the advantages ANAME has over CNAME.</p>
<p>In addition, another advantage ANAME has over CNAME is that it can coexist with other records on that domain name. So if you want to have subdomains, you should use ANAME instead of CNAME.</p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>This article explained what ANAME is and compared it with CNAME so you can know the advantages it has over CNAME.</p>
<p>You might also be wondering which to use between ANAME and CNAME, or when you should use one over the other.</p>
<p>This is the logic: </p>
<ul>
<li>if you know you cannot have other records on a domain name, use CNAME. This is because it cannot coexist with other data on the record for a domain name. </li>
<li>If you will have other records like subdomain on that domain name, then use ANAME. And if you don’t know whether you'll still have a subdomain or not, use ANAME.</li>
</ul>
<p>Thank you for reading.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Flush DNS on Mac – MacOS Clear DNS Cache ]]>
                </title>
                <description>
                    <![CDATA[ In this tutorial, you will learn why flushing your DNS cache is important, and how you can clear the cache on your local system. Here is what we'll discuss in this guide: What is DNS cache? Why flushing DNS cache is important How to flush DNS cach... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-flush-dns-on-mac-macos-clear-dns-cache/</link>
                <guid isPermaLink="false">66b1e41d96a9e0a75592bbbf</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Dionysia Lemonaki ]]>
                </dc:creator>
                <pubDate>Thu, 21 Apr 2022 00:15:54 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/kaitlyn-baker-vZJdYl5JVXY-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>In this tutorial, you will learn why flushing your DNS cache is important, and how you can clear the cache on your local system.</p>
<p>Here is what we'll discuss in this guide:</p>
<ol>
<li><a class="post-section-overview" href="#intro">What is DNS cache?</a><ol>
<li><a class="post-section-overview" href="#why">Why flushing DNS cache is important</a></li>
</ol>
</li>
<li><a class="post-section-overview" href="#howto">How to flush DNS cache on MacOS</a><ol>
<li><a class="post-section-overview" href="#terminal">How to access the terminal application on MacOS</a></li>
<li><a class="post-section-overview" href="#version">How to clear DNS Cache for your MacOS version</a></li>
</ol>
</li>
</ol>
<h2 id="heading-what-is-dns-cache">What is DNS Cache? <a></a></h2>
<p>DNS acts much like an internet phonebook. Think of what a phonebook does – it maps a person's name to their respected phone number. </p>
<p>DNS (short for Domain Name System) maps domain names to their associated IP addresses.</p>
<p>A domain name, such as <code>freecodecamp.org</code>,  is easily read, understood, and recalled by humans.</p>
<p>IP addresses (IP is short for Internet Protocol) is an address that is machine-readable and consists of a unique series of numbers. These numbers identify a device connected to the Internet.</p>
<p>Their format is not that human-friendly since it is hard to remember an exact sequence of numbers each time you want to visit a website.</p>
<p>DNS then maps <code>freecodecamp.org</code> to its associated IP address - <code>104.26.3.33</code>.</p>
<p>Think of the DNS cache as a local storage area on your Mac.  </p>
<p>It temporarily stores and keeps track of your computer's activity records like recent website visits. </p>
<p>Each time you visit a website by typing its URL (short for Uniform Resource Locator), the DNS cache will save the IP address associated with that website.</p>
<p>When you visit that same website for the second time, the lookup process is more efficient, and the lookup time is much shorter.</p>
<p>It helps save significant time.</p>
<h3 id="heading-why-flushing-dns-cache-is-important">Why Flushing DNS Cache Is Important <a></a></h3>
<p>You should flush the DNS cache for a few reasons.</p>
<p>The two most important ones are:</p>
<p>1) <strong>Flushing DNS is a helpful step for troubleshooting Internet connectivity issues</strong>. </p>
<p>You may be getting DNS errors in your browser, such as the 'DNS Server Not Responding' message when trying to access a site and establish a connection.</p>
<p>Keep in mind that your local cache information can become outdated over time. </p>
<p>When DNS updates happen on a website, your Mac is still using the old, inaccurate information to load the requested page. </p>
<p>Flushing the DNS cache makes sure cache information is up to date.</p>
<p>2) <strong>Flushing the DNS cache prevents network security threats, malicious attacks, and DNS cache poisoning from happening</strong>.</p>
<p>Hackers can access and corrupt your saved DNS cache records.</p>
<p>For example, they could manipulate and change the IP address associated with a Domain Name of a website you have already visited and map it to a malicious one.</p>
<p>The next time you request to access that same website, there will be a redirection to a fake and corrupted URL.</p>
<p>Hackers can request personal and sensitive information, such as credit card numbers, and steal it. </p>
<p>Frequent flushing of the DNS cache will help prevent this from occurring.</p>
<h2 id="heading-how-to-flush-dns-cache-on-macos">How to Flush DNS Cache on MacOS <a></a></h2>
<p>Clearing the DNS cache on your Mac is a relatively straightforward process, even if you don't have a lot of technical knowledge.</p>
<p>Here is what you will need:</p>
<ul>
<li>Access to the command line,</li>
<li>Your computer password,</li>
<li>To enter a text command (the command will depend on the version of macOS you are running).</li>
</ul>
<h3 id="heading-how-to-access-the-terminal-application-on-macos">How to Access The Terminal Application on MacOS <a></a></h3>
<p>macOS has a built-in CLI (Command Line Interface) named <code>Terminal.app</code>, which allows you to enter text-based commands that the Operating System will carry out.</p>
<p>There are a few ways to open the terminal.</p>
<p>The easiest way is through Spotlight search.</p>
<p>For this, you can:</p>
<ul>
<li>Either navigate to the very top right corner of the screen and click on the icon that looks like a magnifying glass. </li>
<li>Or, you can also use the <code>Command Space</code> shortcut.</li>
</ul>
<p>Both will open up the following window:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/Screenshot-2022-04-20-at-10.07.52-AM.png" alt="Screenshot-2022-04-20-at-10.07.52-AM" width="600" height="400" loading="lazy"></p>
<p>From there, start typing <code>terminal</code> and click on the <code>Terminal.app</code> option that appears.</p>
<p>You should see a window open that looks similar to the following:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/Screenshot-2022-04-20-at-10.12.29-AM.png" alt="Screenshot-2022-04-20-at-10.12.29-AM" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-clear-dns-cache-for-your-macos-version">How to Clear DNS Cache For Your MacOS Version <a></a></h3>
<p>In the terminal window, you will then need to enter a command.</p>
<p>The command is different depending on the version of macOS you are running.</p>
<p>Each version of macOS has a version number and a version name.</p>
<p>To find out the macOS version on your computer, click on the Apple icon at the very top left corner of your screen. From the dropdown menu that appears, select <code>About This Mac</code>.</p>
<p>In the <code>Overview</code> tab, you will first see the version name. Then, underneath that, you will see the version number.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/Screenshot-2022-04-20-at-11.07.26-AM.png" alt="Screenshot-2022-04-20-at-11.07.26-AM" width="600" height="400" loading="lazy"></p>
<p>In the table below, you will see the versions of macOS in reverse chronological order – from the most recent one to the oldest one. </p>
<p>Navigate to your version of Mac and copy the respective command.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>MacOS Version</td><td>Command</td></tr>
</thead>
<tbody>
<tr>
<td>macOS 12 (Monterey)</td><td><code>sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>macOS 11 (Big Sur)</td><td><code>sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>macOS 10.15 (Catalina)</td><td><code>sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>macOS 10.14 (Mojave)</td><td><code>sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>macOS 10.13 (High Sierra)</td><td><code>sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>macOS 10.12 (Sierra)</td><td><code>sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>OS X 10.11 (El Capitan)</td><td><code>sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>OS X 10.10 (Yosemite)</td><td><code>sudo discoveryutil udnsflushcaches</code></td></tr>
<tr>
<td>OS X 10.9 (Mavericks)</td><td><code>sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>OS X 10.8 (Mountain Lion)</td><td><code>sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>Mac OS X 10.7 (Lion)</td><td><code>sudo killall -HUP mDNSResponder</code></td></tr>
<tr>
<td>Mac OS X 10.6 (Snow Leopard)</td><td><code>sudo dscacheutil -flushcache</code></td></tr>
<tr>
<td>Mac OS X 10.5 (Leopard)</td><td><code>sudo lookupd -flushcache</code></td></tr>
<tr>
<td>Mac OS X 10.4 (Tiger)</td><td><code>lookupd -flushcache</code></td></tr>
</tbody>
</table>
</div><p>After typing the command and hitting enter, there will be a prompt for  entering your computer's password.</p>
<p>Keep in mind that when you are typing your password, you will not be able to view what you are typing – not even any asterisks. </p>
<p>It appears as though nothing is happening, but rest assured that something is.</p>
<p>Once you have entered your password and hit enter, you will not see a message indicating that the process is complete.</p>
<p>Instead, you will view a new terminal prompt.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>And there you have it – your local DNS cache is now clear.</p>
<p>Hopefully, this has helped resolve any connectivity issues you may be experiencing.</p>
<p>Clearing DNS frequently is always a good idea to help fix troublesome internet connections and ensure your system is secure from potential threats.</p>
<p>Thanks for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ DNS Server Not Responding – Service Unavailable DNS Failure [Solved] ]]>
                </title>
                <description>
                    <![CDATA[ Sometimes, you might suddenly discover that you can’t access the internet on your computer because of the error “DNS server not responding”.  If you run a troubleshooter for the issue, you'll get a message like the below: In your Chrome browser, you... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/dns-server-not-responding-service-unavailable-dns-failure-solved/</link>
                <guid isPermaLink="false">66adf0bbf452caf50fb1fde8</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ error ]]>
                    </category>
                
                    <category>
                        <![CDATA[ internet ]]>
                    </category>
                
                    <category>
                        <![CDATA[ servers ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Mon, 11 Apr 2022 15:59:55 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/binary-g3068c576e_1920.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Sometimes, you might suddenly discover that you can’t access the internet on your computer because of the error “DNS server not responding”. </p>
<p>If you run a troubleshooter for the issue, you'll get a message like the below:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss1-1.png" alt="ss1-1" width="600" height="400" loading="lazy"></p>
<p>In your Chrome browser, you might also get an error like the one below:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss2-2.png" alt="ss2-2" width="600" height="400" loading="lazy"></p>
<p>This is because the Domain Name System (DNS) server is crucial in getting an internet connection on your computer.</p>
<p>As far as websites are concerned, the “DNS server not responding” error could be caused by DNS gaps and a DDoS (Distributed Denial of Service) attack. If this is the problem, you might have to wait for 72 hours for domain gaps to be fixed or the website admins to fix the security issues with the website.</p>
<p>On the user’s end, the “DNS server not responding” error could be caused by numerous reasons such as misconfigured DNS settings and outdated browsers. </p>
<p>If this is the cause, I will show you 7 ways to fix the error so you can restore your internet connection.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><a class="post-section-overview" href="#heading-how-does-the-dns-system-work">How Does the DNS System Work?</a></li>
<li><a class="post-section-overview" href="#heading-7-ways-to-fix-the-dns-server-not-responding-error">7 Ways to Fix the DNS Server Not Responding Error</a><ul>
<li><a class="post-section-overview" href="#heading-solution-1-switch-browsers">Solution 1: Switch Browsers</a></li>
<li><a class="post-section-overview" href="#heading-solution-2-temporarily-disable-your-antivirus">Solution 2: Temporarily Disable Your Antivirus</a></li>
<li><a class="post-section-overview" href="#heading-solution-3-restart-your-router-or-modem">Solution 3: Restart your Router or Modem</a></li>
<li><a class="post-section-overview" href="#heading-solution-4-flush-your-dns-cache">Solution 4: Flush your DNS Cache</a></li>
<li><a class="post-section-overview" href="#heading-solution-5-manually-change-your-dns-server">Solution 5: Manually Change your DNS Server</a></li>
<li><a class="post-section-overview" href="#heading-solution-6-update-your-network-adapter-driver">Solution 6: Update Your Network Adapter Driver</a></li>
<li><a class="post-section-overview" href="#heading-solution-7-disable-ipv6">Solution 7: Disable IPv6</a></li>
</ul>
</li>
<li><a class="post-section-overview" href="#heading-final-thoughts">Final Thoughts</a><h2 id="heading-how-does-the-dns-system-work">How Does the DNS System Work?</h2>
</li>
</ul>
<p>Whenever you try to access a website, like freeCodeCamp.org, you type in the URL like “freecodecamp.org” to the address bar and hit <code>ENTER</code>. </p>
<p>Under the hood, the DNS server looks up the numerical address for freeCodeCamp.org. This numerical address is called an Internet Protocol (IP) address.</p>
<p>Once the browser gets this IP address, the website (freeCodeCamp.org or any other) will be shown to you. If the browser fails to find this address, then you might get the “DNS server not responding” error.</p>
<h2 id="heading-7-ways-to-fix-the-dns-server-not-responding-error">7 Ways to Fix the DNS Server Not Responding Error</h2>
<p>Now let's go through seven ways you can use to get rid of the “DNS server not responding” error so your internet connection can be restored.</p>
<h3 id="heading-solution-1-switch-browsers">Solution 1: Switch Browsers</h3>
<p>The “DNS server not responding” error could be showing up because of the browser you’re currently using. Some browsers have their own DNS cache and if there’s an issue with the cache, your internet experience on that browser could be negatively affected. </p>
<p>So, a non-complicated fix is to change to a different browser and see if the error persists. </p>
<p>For example, if you are using Chrome, switch to Edge if you are on Windows or Safari if you are using Mac. </p>
<p>If the website loads up in another browser, then you might need to update your other browser or reinstall it.</p>
<h3 id="heading-solution-2-temporarily-disable-your-antivirus">Solution 2: Temporarily Disable Your Antivirus</h3>
<p>Antivirus programs are notorious for interfering with applications and stopping them from working properly.</p>
<p>If you are getting the “DNS server not responding” error, consider disabling your antivirus program to see if your internet connection works fine. </p>
<p>If you are able to access the internet after disabling the antivirus, then it is the reason you’re getting the error. </p>
<p>In this case, you may want to consider getting another antivirus program.</p>
<p>If you are on Windows 10, you can disable Windows Security (AKA Windows Defender) by following the steps below:
<strong>Step 1</strong>: Press <code>ALT</code> + <code>SHIFT</code> + <code>ESC</code> on your keyboard to open the Task Manager</p>
<p><strong>Step 2</strong>: Switch to the Startup tab</p>
<p><strong>Step 3</strong>: Locate your Antivirus Program in the list, right-click on it and select "Disable".
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss3-1.png" alt="ss3-1" width="600" height="400" loading="lazy"></p>
<h3 id="heading-solution-3-restart-your-router-or-modem">Solution 3: Restart your Router or Modem</h3>
<p>If your internet connection relies on a router or modem, restarting it could help you get rid of the “DNS server not responding” error. </p>
<p>This is because turning off and then turning on a router or modem clears the cache of IP addresses. This could fix the error in the long run.</p>
<p>To restart your router or modem, locate the power button and long press to turn it off, then turn it on again.</p>
<h3 id="heading-solution-4-flush-your-dns-cache">Solution 4: Flush your DNS Cache</h3>
<p>If the “DNS server not responding” error is due to misconfiguration on your device, flushing your DNS is one of the most reliable ways to fix it. This is because the process would remove invalid IP configurations and outdated information in the DNS cache.</p>
<p>To flush your computer’s DNS on Windows, follow the steps highlighted below:</p>
<p><strong>Step 1</strong>: Hit the <code>WIN</code> button on your keyboard and search for "cmd". Then select "Run as Administrator" on the right.</p>
<p><strong>Step 2</strong>: Enter and execute the following commands one after the other:</p>
<ul>
<li><code>ipconfig /flushdns</code></li>
<li><code>ipconfig /release</code></li>
<li><code>ipconfig /renew</code>
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss4.png" alt="ss4" width="600" height="400" loading="lazy"></li>
</ul>
<p><strong>Step 3</strong>: Restart your computer</p>
<h3 id="heading-solution-5-manually-change-your-dns-server">Solution 5: Manually Change your DNS Server</h3>
<p>Using the default DNS server of your internet service provider could be the reason you are getting the “DNS server not responding” error.</p>
<p>You can change your DNS server to one of the free ones provided by the likes of Google and Cloudflare.</p>
<p>The steps below show you how to change your DNS server to Google's: </p>
<p><strong>Step 1</strong>: Right-click on Start and select “Network Connections”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss5.png" alt="ss5" width="600" height="400" loading="lazy"></p>
<p><strong>Step 2</strong>: Scroll down and select “Change adapter options”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss6.png" alt="ss6" width="600" height="400" loading="lazy"></p>
<p><strong>Step 3</strong>: In the pop-up that appears, right-click on the network you are connected to and select “Properties”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss7.png" alt="ss7" width="600" height="400" loading="lazy"></p>
<p><strong>Step 4</strong>: In the next pop-up that appears, double-click on “Internet Protocol Version 4 (TCP/IPv4)”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss8.png" alt="ss8" width="600" height="400" loading="lazy"></p>
<p><strong>Step 5</strong>: In the following pop-up that appears, click the radio button that says “Use the following DNS server addresses”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss9.png" alt="ss9" width="600" height="400" loading="lazy"></p>
<p><strong>Step 6</strong>: Enter 8.8.8.8 for “Preferred DNS server” and 8.8.4.4 for “Alternate DNS server”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss10.png" alt="ss10" width="600" height="400" loading="lazy"></p>
<p>This is the free DNS server provided by Google.</p>
<p><strong>Step 7</strong>: Click “Ok”, and “Ok” again.</p>
<p>N.B.: If your computer is configured to use IPv6 instead of IPv4, then in step 4, you should choose “Internet Protocol Version 6 (TCP/IPv6)” instead of “Internet Protocol Version 4 (TCP/IPv4)”.</p>
<h3 id="heading-solution-6-update-your-network-adapter-driver">Solution 6: Update Your Network Adapter Driver</h3>
<p>Updating your network adapter driver can fix a lot of technical issues – including the “DNS server not responding” error, since the new driver could include bug fixes.</p>
<p>To update your network adapter driver, you can do it with the steps below:</p>
<p><strong>Step 1</strong>: Click on Start and select Device Manager.</p>
<p><strong>Step 2</strong>: Expand Network Adapters.</p>
<p><strong>Step 3</strong>: Right-click on the affected driver and select Update driver:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss11.png" alt="ss11" width="600" height="400" loading="lazy"></p>
<p><strong>Step 4</strong>: Choose Search automatically for updated driver software:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss12.png" alt="ss12" width="600" height="400" loading="lazy"></p>
<p><strong>Step 5</strong>: Allow your computer to search for a driver online and install it for you. When it is done installing, restart your computer.</p>
<h3 id="heading-solution-7-disable-ipv6">Solution 7: Disable IPv6</h3>
<p>If your current network is configured to use IPv4 and IPv6 is turned on on your computer, it could lead to negative interference which could make you get the “DNS server not responding” error.</p>
<p>To disable IPv6, the following steps can help you:</p>
<p><strong>Step 1</strong>: Right-click on Start and select “Network Connections”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss5.png" alt="ss5" width="600" height="400" loading="lazy"></p>
<p><strong>Step 2</strong>: Scroll down and select “Change adapter options”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss6.png" alt="ss6" width="600" height="400" loading="lazy"></p>
<p><strong>Step 3</strong>: In the pop-up that appears, right-click on the network you are connected to and select “Properties”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss7.png" alt="ss7" width="600" height="400" loading="lazy"></p>
<p><strong>Step 4</strong>: In the next pop-up that appears, uncheck “Internet Protocol Version 6 (TCP/IPv6)”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss13.png" alt="ss13" width="600" height="400" loading="lazy"></p>
<p><strong>Step 6</strong>: Click “Ok”, and “Ok” again.</p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>The “DNS server not responding” error can be frustrating and disturb your internet experience. But in this article you've learned how to fix it if the error is caused by misconfiguration of DNS from the user’s end. </p>
<p>I hope one of the solutions to the error explained in this article helps you fix the error.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ flushdns – How to Flush DNS with the Windows ipconfig /flushdns Command ]]>
                </title>
                <description>
                    <![CDATA[ You've probably noticed that, after visiting a website for the first time, the website loads much quicker the next time you visit. This is because your operating system, or browser in the case of Google Chrome, cache IP addresses and DNS (Domain Name... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/flushdns-how-to-flush-dns-with-the-windows-ipconfig-flushdns-command/</link>
                <guid isPermaLink="false">66adf0d76f5e63db3fc43605</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ networking ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows 10 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Thu, 07 Apr 2022 03:41:13 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/domain-names-1772240_1920.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>You've probably noticed that, after visiting a website for the first time, the website loads much quicker the next time you visit.</p>
<p>This is because your operating system, or browser in the case of Google Chrome, cache IP addresses and DNS (Domain Name System) information of any website you visit. The DNS cache contains:</p>
<ul>
<li>the website address or hostname, technically called the resource data (rdata)</li>
<li>the domain name of the website</li>
<li>record type (IPv4 or IPv6)</li>
<li>the validity of the cache or TTL (time to live)</li>
</ul>
<p>When the TTL expires, the cache will be cleared, and the DNS is flushed for you automatically. But there are times when you don't want to wait hours or days for the TTL to expire, and want to flush your DNS manually.</p>
<p>In this article, I'll go over why you should flush your DNS, and how to do that in Windows 10 and Chrome.</p>
<h2 id="heading-so-why-should-you-flush-or-clear-your-dns">So, Why Should You Flush (or Clear) Your DNS?</h2>
<p>Flushing your DNS has several advantages, such as:</p>
<ul>
<li>hiding your search behavior from data collectors who might show you ads based on your search history</li>
<li>requesting that an updated version of a website or web app is loaded. This can help resolve 404 issues if a website or web app was migrated to a new domain</li>
<li>preventing DNS cache poisoning – a security situation in which black hat hackers gain maliciously gain access to your DNS cache and alter them so you get redirected to a website where sensitive information might be collected from you</li>
</ul>
<h2 id="heading-how-to-flush-your-dns-on-windows">How to Flush Your DNS on Windows</h2>
<p>To flush your DNS records on Windows 10, follow the steps below:</p>
<p><strong>Step 1</strong>: Click on Start or hit the Windows <code>[logo]</code> key on your keyboard</p>
<p><strong>Step 2</strong>: Type "cmd", then select "Run as Administrator" on the right</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/cmd-admin.jpg" alt="cmd-admin" width="600" height="400" loading="lazy"></p>
<p><strong>Step 3</strong>: Type in "ipconfig /flushdns" and hit <code>ENTER</code></p>
<p>You should get a response that the DNS cache has been flushed like the one below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/flushDNS.png" alt="flushDNS" width="600" height="400" loading="lazy"></p>
<p>This means that your cache has been completely cleared, and fresh versions of any website you visit will be loaded.</p>
<h2 id="heading-how-to-clear-the-dns-cache-on-google-chrome">How to Clear the DNS Cache on Google Chrome</h2>
<p>Despite not being an operating system, Chrome keeps a DNS cache of its own to help personalize your browsing experience.</p>
<p>To flush Chrome's DNS, all you need to do is type <code>chrome://net-internals/#dns</code> in the address bar and hit <code>ENTER</code>. </p>
<p>Then click “Clear host cache”:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/flushChromeDNS.png" alt="flushChromeDNS" width="600" height="400" loading="lazy"></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>As you’ve learned in this article, flushing your DNS gives you a lot of advantages that can make your internet experience safer. </p>
<p>Even though the cache gets cleared after the TTL expires, you should flush your DNS as often as possible so you can get these advantages.</p>
<p>Thank you for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is DNS? Domain Name System, DNS Server, and IP Address Concepts Explained ]]>
                </title>
                <description>
                    <![CDATA[ By Chloe Tucker Introduction By the end of this article, you should have a better understanding of: What DNS is and what it does What DNS servers do How Internet Protocol (IP) Addresses work in the context of DNS Important concepts There are some e... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-dns/</link>
                <guid isPermaLink="false">66d45e04aad1510d0766b5fb</guid>
                
                    <category>
                        <![CDATA[ nameserver ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ARPANET ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ domain names ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 11 May 2020 11:00:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/05/earth-3866609_1920.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Chloe Tucker</p>
<h2 id="heading-introduction">Introduction</h2>
<p>By the end of this article, you should have a better understanding of:</p>
<ol>
<li>What DNS is and what it does</li>
<li>What DNS servers do</li>
<li>How Internet Protocol (IP) Addresses work in the context of DNS</li>
</ol>
<h3 id="heading-important-concepts">Important concepts</h3>
<p>There are some essential mental models to be familiar with when learning about DNS, DNS servers, and IP addresses. Going over these concepts now, before starting to learn about DNS, will</p>
<ul>
<li>help make sense of all the different terms used to describe behavior that fits into these models, and</li>
<li>aid in memory retention.</li>
</ul>
<p>Mental models give you a frame of reference when things get a little weird and unfamiliar.</p>
<p>So let’s lay the groundwork.  </p>
<ul>
<li>Query and response. This is when Thing 1 asks Thing 2 for something, and Thing 2 responds to that request. Like this:</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Query-Response.jpg" alt="Query and response example" width="600" height="400" loading="lazy">
<em>Query and Response</em></p>
<ul>
<li>Parent-child node relationships and graphs that look like this (only more complicated).</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Parent-Child.jpg" alt="Parent and child node tree graphs" width="600" height="400" loading="lazy">
<em>Tree graph</em></p>
<ul>
<li>Messages. It’s not a query and response because there is no response. In the world of DNS, the formatting and content of messages vary according to usage.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Message.jpg" alt="Message example" width="600" height="400" loading="lazy">
<em>Message</em></p>
<ul>
<li>Client-server relationship. In simplest terms, a server is a software or hardware device that provides functionality for other software or hardware devices, called “clients.”   </li>
</ul>
<p>Prepare for a lot of talk about servers. As it turns out, there’s a whole lot of servers that go into this thing we call DNS, and how we, as humans, use it when we connect to the Internet.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Client-Server.jpg" alt="Server and clients example image" width="600" height="400" loading="lazy">
<em>Client-server relationship</em></p>
<h2 id="heading-what-is-dns">What is DNS?</h2>
<p>The Domain Name System (DNS) maps human-readable domain names (in URLs or in email address) to IP addresses. For example, DNS translates and maps the domain <a target="_blank" href="http://www.freecodecamp.org">freecodecamp.org</a> to the IP address 104.26.2.33.</p>
<p>To help you fully understand this description, this section details:</p>
<ul>
<li>Historical context for the development of DNS - what problems were it and IP addresses solving?</li>
<li>Domain names</li>
<li>IP addresses</li>
</ul>
<h3 id="heading-historical-context">Historical Context</h3>
<p>In 1966, the Advanced Research Projects Agency (ARPA), a US government agency, founded a computer network called ARPAnet. In simple terms, think of ARPAnet as the first iteration of what we now know today as the Internet.</p>
<p>The main goals of ARPAnet included </p>
<blockquote>
<p>“(1) providing reliable communication even in the event of a partial equipment or network failure, (2) being able to connect to different types of computers and operating systems and (3) being a cooperative effort rather than a monopoly controlled by a single corporation. In order to provide reliable communication in the face of equipment failure, ARPANET was designed so that no one point or link was more critical than any other. This was accompanied by the building of redundant routes and the use of on-the-fly rerouting of data if any <a target="_blank" href="http://www.linfo.org/arpanet.html">part of the network failed.</a>”</p>
</blockquote>
<h3 id="heading-the-problems">The Problems</h3>
<p>DNS and TCP/IP were critical in solving two issues with ARPAnet:</p>
<p><strong>For ARPAnet, there was a single location (a file called HOSTS.TXT) that contained all name-to-address mapping for every host on the network.</strong></p>
<blockquote>
<p>“HOSTS.TXT was maintained by SRI’s <em>Network Information Center</em> (dubbed “the NIC”) and distributed from a single host, SRI-NIC.[<a target="_blank" href="https://learning.oreilly.com/library/view/dns-and-bind/0596100574/ch01.html#ftn.dns5-CHP-1-FN1">*</a>] ARPAnet administrators typically emailed their changes to the NIC, and periodically FTP’ed to SRI-NIC and grabbed the current HOSTS.TXT file. Their changes were compiled <a target="_blank" href="https://learning.oreilly.com/library/view/dns-and-bind/0596100574/ch01.html">into a new <em>HOSTS.TXT</em> file once or twice a week.</a>”</p>
</blockquote>
<p>There were three challenges with this set-up:</p>
<ol>
<li>Traffic and load - distributing the file was becoming too much for the responsible host to handle.</li>
<li>Name collisions - each host had to have a unique name, and there was no centralized authority that prevented network users from adding a host with a conflicting (non-unique) name, thereby “breaking the whole scheme.”</li>
<li>Consistency - the act of updating the file and ensuring all hosts had the most updated version became impossible or at least very difficult.</li>
</ol>
<p>In essence, HOSTS.TX was a single point of failure, so the entire process here didn’t scale well past a certain number of hosts. ARPAnet needed a <em>decentralized</em> and scalable solution. DNS was it. <a target="_blank" href="https://learning.oreilly.com/library/view/dns-and-bind/0596100574/ch01.html">Source</a></p>
<p><strong>Host-to-host communication within the same network wasn’t reliable enough. TCP/IP helped solve this issue.</strong></p>
<ol>
<li>Transmission Control Protocol (TCP) provides quality assurance measures for the process of turning messages (between hosts) into packets. The TCP protocol is connection-oriented, which means a connection between source host and destination host must be established.</li>
<li>Internet Protocol (IP) defines how messages (packets) are carried between source host and destination host. An IP address is a unique identifier for a specific path that leads to a host on a network.</li>
<li>TCP and IP work closely together, which is why they’re usually referenced like “TCP/IP.”</li>
<li>While I won’t dive into it in this article, both TCP and User Datagram Protocol (UDP) are used in the data transport layer of DNS. UDP is faster, much less reliable, and doesn’t require connections; TCP is slower, much more reliable, but needs connections. They are used as needed and appropriate in DNS; needless to say, the inclusion of TCP in APRAnet was a valuable addition to the data transport layer.</li>
</ol>
<p>By the early 1980s, DNS and TCP/IP (and therefore, IP addresses) were standard operating procedures for the ARPAnet.</p>
<p>This history is <em>very</em> abridged. If you’d like to learn more about these topics, please reference the Resources section at the end of this article.</p>
<p>Now that we have some historical context, let’s move on to learning more about domain names and IP addresses.</p>
<h2 id="heading-domain-names">Domain Names</h2>
<p>In the context of DNS, a domain name provides a user-friendly way to point to non-local resources. This could be a website, a mail system, print server, or any other server that is available on the Internet. A domain name can be more than just a website!</p>
<blockquote>
<p>“The goal of domain names is to provide a mechanism for naming resources in such a way that the names are usable in different <a target="_blank" href="https://tools.ietf.org/html/rfc1035">hosts, networks, protocol families, internets, and administrative organizations.</a>”</p>
</blockquote>
<p>A domain name is much easier to remember and enter into a terminal or Internet browser, than an IP address.</p>
<p>A domain name is part of a Uniform Resource Locator (URL), but the terms are <em>not synonymous</em>. A URL is the complete web address of a resource, while the domain name is the name of a website and is a sub-component of every URL. </p>
<p>While there are technical distinctions between URLs and domain names, web browsers usually treat them the same way, so you’ll get to the website if you type in the complete web address, or just the domain name.</p>
<h3 id="heading-top-level-domains-and-second-level-domains">Top Level Domains and Second Level Domains</h3>
<p>There are two parts to any given domain: top-level domain (TLD) and second-level domain (SLD). The parts of a domain name become more specific when moving from the right (end) to the left (beginning). </p>
<p>This can be confusing at first. For example, let’s look at “freecodecamp.org”</p>
<ul>
<li>URL: https://www.freecodecamp.org</li>
<li>Domain name: freecodecamp.com</li>
<li>TLD: org</li>
<li>SLD: freecodecamp</li>
</ul>
<p>In the early days of ARPAnet, there were a limited number of TLDs available, including com, edu, gov, org, arpa, mil, and 2-letter country code domains. These TLDs were initially reserved for institutions participating in the ARPAnet, but some later became available on commercial markets. </p>
<p>Today, there is a comparative wealth of available TLDs, including net, aero, biz, coop, info, museum, name, and others.</p>
<p>Second-level domains are the domains that are available for individual purchase through domain registrars (for example, Namecheap).</p>
<h2 id="heading-ip-addresses">IP Addresses</h2>
<p>While IP addresses are related to DNS in their function, the Internet Protocol itself is technically separate from DNS. I’ve already provided historical context for this distinction, so now I’ll explain how IP addresses function.</p>
<p>An IP address, as previously mentioned, is a unique identifier for a specific path that leads to a host on a network. I’d like to reference the analogy of a phone number and a phone: a phone number doesn’t represent the phone itself, it’s just a way to reach the person with the phone. </p>
<p>This analogy is reasonably appropriate (at least, on a surface level), with IP addresses. An IP address represents an endpoint, but it isn’t the endpoint itself. IP assignments can be fixed (permanent) or dynamic (flexible and may be reassigned).</p>
<p>Like a domain name, the organization of IP addresses follows a hierarchical structure. Unlike domain names, IP addresses get more specific going left-to-right. This is an IPv4 example below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/11/1-IPV4-Example.png" alt="Diagram of network and host portions of an IPv4 address" width="600" height="400" loading="lazy">
<em>This diagram shows that 129.144 is the network part and 50.56 is the host part of an IPv4 address.</em></p>
<ul>
<li>Network: the unique number assigned to your network</li>
<li>Host: identifies the host (machine) on the network</li>
</ul>
<p>If greater specificity is needed, <a target="_blank" href="https://docs.oracle.com/cd/E19683-01/806-4075/ipref-1/index.html">network administrators can subnet the address space and delegate additional numbers</a>.</p>
<h3 id="heading-how-many-ip-addresses-are-there">How many IP addresses are there?</h3>
<p>IPv4 was the very first iteration of IP that ARPAnet used in production. Deployed in the early 80s, it’s still the most prevalent IP version. It’s a 32-bit scheme, and can therefore support slightly over 4 billion addresses.</p>
<p>But wait, is that enough? Nope.</p>
<p>IPv6 has a 128-bit scheme, which allows it to support 340 undecillion addresses. It also offers performance improvements on IPv4.</p>
<p>Example IPv4 address: </p>
<ul>
<li>104.26.2.33 (freeCodeCamp)</li>
</ul>
<p>Example IPv6 address:</p>
<ul>
<li>2001:db8:a0b:12f0::1 (the compressed format and not pointing to freeCodeCamp)</li>
</ul>
<h1 id="heading-how-does-the-domain-name-system-work">How does the Domain Name System work?</h1>
<p>So, we’ve learned about domain names! We’ve learned about IP addresses! Now how do they relate to the Domain Name System?</p>
<p>First of all, they fit into the namespace.</p>
<h2 id="heading-the-domain-namespace">The Domain Namespace</h2>
<p>As implied by the language “top” level domain and “second” level domain, the namespace is based on a hierarchy </p>
<blockquote>
<p>“...with the hierarchy roughly corresponding to organizational structure, and names using "." as the character to mark the boundary between hierarchy levels.” <a target="_blank" href="https://tools.ietf.org/html/rfc1034">Source</a>. </p>
</blockquote>
<p>This tree graph, with the root at the top, best illustrates the structure:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Namespace.jpg" alt="Root and namespace tree graph example" width="600" height="400" loading="lazy">
<em>The Namespace</em></p>
<p>Let’s break this down, starting at the top.</p>
<p>The top of this graph, noted with a “.” is called the “root.” </p>
<blockquote>
<p>“The authoritative name servers that serve the DNS root zone, commonly known as the “root servers”, are a network of hundreds of servers in many countries around the world. They are configured in the <a target="_blank" href="https://www.iana.org/domains/root/servers">DNS root zone as 13 named authorities.</a>”</p>
</blockquote>
<p>The root domain has a zero-length label.</p>
<p>From here-on down, each node (dot) in the graph has a unique label up to 63 characters long.</p>
<p>The first level down from the root are the TLDs: the com, org, edu, and gov. Please note that this graph does not contain a full list of TLDs.</p>
<p>Below TLDs are the SLDs, the second-level domains. The children of each node are called “subdomains,” which are still considered part of the parent domain. For example, in freecodecamp.org, freecodecamp (the SLD) is a subdomain of org (the TLD).</p>
<p>Depending on the hierarchy of the website, there may be third-, fourth, fifth- level domains. For example, in hypothetical-subdomain.freecodecamp.org, hypothetical-subdomain is the third-level domain, and the subdomain of freecodecamp. So on and so forth, at least up to 127 levels, which is the maximum allowed by DNS.</p>
<h3 id="heading-who-manages-the-namespace">Who manages the namespace?</h3>
<p>Wouldn’t it be nuts to try to have one person or organization administer everything? Yes, it would. Especially because one of the chief design goals of DNS was to promote distributed, decentralized management of the system at large.</p>
<p>I wish I could tell you the folks in charge are called the “Namespace Kings,” but alas.</p>
<p>Each domain (or subdomain) in the domain namespace is or is part of a <em>zone</em>, “an autonomously administered piece of the namespace.” So, the namespace is broken into zones.</p>
<p>Responsibility for those zones is managed through delegation and administration.</p>
<p>The process of assigning the responsibility of subdomains to other entities is called <em>delegation.</em> </p>
<p>For example, the Public Interest Registry administers the domain name org, and has since 2003. Public Interest Registry may delegate responsibility to other parties to manage subdomains of org, say freecodecamp. And then whoever administers freecodecamp may assign responsibility for the subdomains of freecodecamp (for example, hypothethical-subdomain.freecodecamp.com) to another party.</p>
<p>If someone (an organization, team, or individual) administers a zone, what they’re doing is administering the <a target="_blank" href="https://learning.oreilly.com/library/view/dns-and-bind/0596100574/ch01.html">nameserver that is responsible for the zone</a>.</p>
<p>This brings us into one of the most foundational concepts in the Domain Name System.</p>
<h2 id="heading-domain-name-servers">Domain Name Servers</h2>
<blockquote>
<p>“The programs that store information about the <a target="_blank" href="https://learning.oreilly.com/library/view/dns-and-bind/0596100574/ch02.html">domain namespace are called nameservers.</a>”</p>
</blockquote>
<p>At this point is where thinking about a client-server relationship, at least initially, is useful. Domain nameservers are the “server” side of the client-server relationship. Nameservers may load one, hundreds, or even thousands of zones, but they never load the entire namespace. Once a nameserver has loaded the totality of a zone, it is said to be <em>authoritative</em> for that zone.</p>
<p>To understand why nameservers function the way they do, it’s useful to understand the “client” part of the relationship.</p>
<h3 id="heading-resolvers">Resolvers</h3>
<p>In DNS, the client (the requester of information) is called the “resolver,” which may seem backward at first. Wouldn’t the server that is resolving the request be called the “resolver?” I thought so, too, but it’s not. Best to just memorize that and move on.</p>
<p>Resolvers are typically included, de facto, in most operating systems, so the applications installed on the OS don’t have to figure out how to make low-level DNS queries. </p>
<p>DNS queries and their responses are types of DNS messages, and have their own data transport protocol (usually UDP). Resolvers are responsible for helping applications installed on the OS translate requests for DNS-related data into DNS queries. </p>
<p>In sum, resolvers are responsible for packaging and sending off requests for data. Once the resolver receives the response (if at all), it passes that back to the original requesting application in a format consumable to the requesting application.</p>
<h3 id="heading-back-to-nameservers">Back to Nameservers</h3>
<p>Now that we are a bit more familiar with the client-side of the relationship, we need to understand how domain nameservers respond to resolver queries. </p>
<p>Nameservers respond to DNS queries through <em>resolution</em>. Resolution is the process by which nameservers find datafiles in the namespace. Depending on the type of query, nameservers respond differently to different queries, but the end goal is resolution.</p>
<h3 id="heading-query-types">Query Types</h3>
<p>Type of query? Yes, there are multiple types of DNS queries. But first, what’s usually in a DNS query? It’s a request for information, specifically for the IP address associated with a domain name.</p>
<ul>
<li><em>Recursive</em>: recursive queries allow the query to be referred on to multiple nameservers to be resolved. If the first queried nameserver doesn’t have the desired data, then that nameserver sends the query along to the most appropriate next nameserver, until the nameserver with the desired datafiles is found and sends a response to the resolver.</li>
<li><em>Iterative</em>: iterative queries require the queried nameserver to respond either with the desired data or with an error. The response may contain the IP address of the most appropriate nameserver to send the request to next; the resolver may then send another request to that, more appropriate, nameserver.</li>
</ul>
<p>In case you need it, you can also query for the domain name, if all you have is the IP address. This is called a reverse DNS lookup.</p>
<p>Once the query reaches a nameserver that contains the desired datafiles, then the query can be resolved. Nameservers have a number of datafiles associated with them, all or some of which may be used to resolve the query.</p>
<h3 id="heading-resource-records-rrs">Resource Records (RRs)</h3>
<p>These are the datafiles in the domain namespace. These datafiles have specific formats and contents.</p>
<p>The most common RRs:</p>
<ul>
<li>A Record: if you haven’t heard of any other RRs except for this one, that would make sense. It’s likely the best-known RR and contains the IP address of the given domain.</li>
<li>CNAME Record: if you haven’t heard of any other RRs except for this one and the A record, that would also make sense. The “C” stands for “canonical”, and is used instead of an A record, to assign an alias to a domain.</li>
<li>SOA Record: this record contains administrative information about the one, including the email address of the administrator. Hint: if you administer a zone, make sure there’s a valid email address here, so folks can get in touch with you if needed.</li>
<li>Other important Resource Record (RR) types are PR, NS, SRV, and MX. <a target="_blank" href="https://support.google.com/domains/answer/3251147?hl=en">Read about them here</a>.</li>
</ul>
<h3 id="heading-caching-and-time-to-live-ttl">Caching and Time to Live (TTL)</h3>
<p>When the local nameserver receives a response from a query, it caches that data (stores it in memory), so next time it receives the same query, it can just answer the query directly rather than go through the original, longer resolution process.</p>
<p>But once this information is cached, it is both static and isolated, and is therefore at risk of becoming out of date. Therefore, resource records all have what is called a <em>time to live</em> (TTL) value, which dictates how long that data can be cached. When that time runs out (reaches zero), the nameserver deletes the record.</p>
<p>Important note: TTL doesn’t apply to the name servers that are authoritative for the zone that contains the resource record. It just applies to the nameserver that cached that resource record.</p>
<h1 id="heading-a-day-in-the-life-of-a-query">A Day in the Life of a Query</h1>
<p>We’ve covered a lot of ground in this article, and it’s been heavy on the concepts. To tie this all together and make it real, here’s a day (figurative day) in the life of a query.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/11/2-Day-in-the-Life-of-a-Query.png" alt="Diagram showing how a query is resolved" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.oreilly.com/library/view/dns-and-bind/0596100574/ch02.html">Source</a></em></p>
<h1 id="heading-so-why-do-i-need-to-know-all-of-this">So why do I need to know all of this?</h1>
<p>There are so many reasons to be familiar with DNS and IP address related concepts.</p>
<ul>
<li>First, it’s a backbone of the Internet, the thing many of us use, develop feelings for (love/hate/you-name-it), and take for granted every day. It’s important to be familiar with the structures that enable us to accomplish great things today with technology and the Internet today.</li>
<li>Incredibly smart people spent decades of their lives building this stuff! Let’s acknowledge and appreciate their contributions.</li>
<li>Now that I got the gushy stuff out of the way, it’s important to be familiar with DNS concepts in case you’re responsible for anything relating to infrastructure in your company or team or your own business. Having a frame of reference when significant issues crop up allows you to act that much faster and find solutions that much sooner.</li>
</ul>
<h1 id="heading-conclusion">Conclusion</h1>
<p>At this point, you should understand what DNS is and what a nameserver is, as well as be familiar with technical concepts relating to IP addresses.</p>
<p>Many books have been written about and dive deeper into the fascinating world of DNS, and there is so much more to learn. The topics that were not included in this article but are either part of DNS or very related include:</p>
<ul>
<li>Nameserver implementations</li>
<li>Forwarding</li>
<li>(More about) node labels</li>
<li>Primary and secondary nameserver relationships</li>
<li>Retransmission algorithms</li>
<li>Load balancing</li>
<li>Plus, other more general topics about the how the Internet functions, like:</li>
<li>World Wide Web</li>
<li>HTTP</li>
<li>FTP</li>
<li>Communication protocol layers: link layer, IP layer, transport layer, Internet layer, etc.</li>
</ul>
<p>For those of you who are still reading and want to learn more about DNS, I first and foremost recommend “DNS and BIND, 5th Ed.”, written by Cricket Liu and published by O’Reilly Media. It’s invaluable. </p>
<p>I also encourage everyone to poke around in the original Request for Comments (RFCs) linked below. Not only are there points for reading primary sources, but they’re also exceptionally well-organized and comprehensible documents, which is why I quoted them in this article.</p>
<h1 id="heading-resources">Resources</h1>
<ol>
<li><a target="_blank" href="https://tools.ietf.org/html/rfc1034">RFC 1034: DOMAIN NAMES - CONCEPTS AND FACILITIES</a></li>
<li><a target="_blank" href="https://tools.ietf.org/html/rfc1035">RFC 1035: DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION</a></li>
<li><a target="_blank" href="https://tools.ietf.org/html/rfc1122">RFC 1122: Requirements for Internet Hosts -- Communication Layers</a></li>
<li><a target="_blank" href="https://ec2.freesoft.org/CIE/Course/Section2/5.htm">More about DNS Design Goals, from Connected: An Internet Encyclopedia</a></li>
<li><a target="_blank" href="https://theconversation.com/how-the-internet-was-born-from-the-arpanet-to-the-internet-68072">How the Internet was Born from the ARPAnet to the Interpret, from The Conversation</a></li>
<li><a target="_blank" href="https://learning.oreilly.com/videos/learning-dns/9781771373692?autoplay=false">Learning DNS Video Course, by Cricket Liu, from O'Reilly Media</a></li>
</ol>
<h3 id="heading-a-bit-about-me">A bit about me</h3>
<p>I'm Chloe Tucker, an artist and developer in Portland, Oregon. As a former educator, I'm continuously searching for the intersection of learning and teaching, or technology and art. Reach out to me on Twitter <a target="_blank" href="https://twitter.com/_chloetucker">@_chloetucker</a> and check out my website at <a target="_blank" href="https://chloe.dev/">chloe.dev</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Setup DNS for a Website Using Kubernetes, EKS, and NGINX ]]>
                </title>
                <description>
                    <![CDATA[ By Adam Henson As the creator of Foo, a platform for website quality monitoring, I recently endeavored in a migration to Kubernetes and EKS (an AWS service). Kubernetes provides a robust level of DNS support. Luckily for us, within a cluster, we can ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-setup-dns-for-a-website-using-kubernetes-eks-and-nginx/</link>
                <guid isPermaLink="false">66d45d5dbd438296f45cd37d</guid>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Kubernetes ]]>
                    </category>
                
                    <category>
                        <![CDATA[ nginx ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 07 May 2020 11:30:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/05/nyc.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Adam Henson</p>
<p>As the creator of <a target="_blank" href="https://www.foo.software/">Foo, a platform for website quality monitoring</a>, I recently endeavored in a migration to Kubernetes and EKS (an AWS service).</p>
<p>Kubernetes provides a robust level of DNS support. Luckily for us, within a cluster, we can reference pods by host name as defined in a spec. </p>
<p>But what if we want to expose an app to the outside world as a website under a static domain? I thought this would be a common, well documented case, but boy was I wrong.</p>
<blockquote>
<p>Assume a Service named <code>foo</code> in the Kubernetes namespace <code>bar</code>. A Pod running in namespace <code>bar</code> can look up this service by simply doing a DNS query for <code>foo</code>. A Pod running in namespace <code>quux</code> can look up this service by doing a DNS query for <code>foo.bar</code> ~ <a target="_blank" href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/">DNS for Services and Pods - Kubernetes</a></p>
</blockquote>
<p>Yes, that's great ❤️ But this still leads to many unsolved mysteries. Let's take this one step at a time shall we?! This post will address the following items.</p>
<ol>
<li><strong>How to define services</strong></li>
<li><strong>How to expose multiple services under one NGINX server</strong>. No fancy schmancy "<a target="_blank" href="https://kubernetes.io/docs/concepts/services-networking/ingress/">Ingress</a>" needed <strong>?</strong></li>
<li><strong>How to create an external DNS and connect to a domain</strong> you've acquired through any qualified registry like GoDaddy or Google Domains, for example. We'll use <a target="_blank" href="https://aws.amazon.com/route53/">Route 53</a> and <a target="_blank" href="https://github.com/kubernetes-sigs/external-dns">ExternalDNS</a> to do the heavy lifting.</li>
</ol>
<p>This post assumes a setup with EKS and <code>eksctl</code> as documented in "<a target="_blank" href="https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html">Getting started with <code>eksctl</code></a>", but many of the concepts and examples in this post could be applicable in a variety of configurations.</p>
<h2 id="heading-step-1-define-services">Step 1: Define Services</h2>
<p><a target="_blank" href="https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/">Connecting Applications with Services</a> explains how to expose an NGINX application by defining a <code>Deployment</code> and <code>Service</code>. Let's go ahead and create 3 applications in the same manner: a user facing web app, an API and a reverse proxy NGINX server to expose the two apps under one host.</p>
<blockquote>
<p>web-deployment.yaml</p>
</blockquote>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">apps/v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Deployment</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">web</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">matchLabels:</span>
      <span class="hljs-attr">app:</span> <span class="hljs-string">web</span>
  <span class="hljs-attr">template:</span>
    <span class="hljs-attr">metadata:</span>
      <span class="hljs-attr">labels:</span>
        <span class="hljs-attr">app:</span> <span class="hljs-string">web</span>
    <span class="hljs-attr">spec:</span>
      <span class="hljs-attr">containers:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">web</span>
        <span class="hljs-comment"># etc, etc</span>
</code></pre>
<blockquote>
<p>web-service.yaml</p>
</blockquote>
<pre><code>apiVersion: v1
<span class="hljs-attr">kind</span>: Service
<span class="hljs-attr">metadata</span>:
  name: web
  <span class="hljs-attr">labels</span>:
    app: web
<span class="hljs-attr">spec</span>:
  ports:
  - name: <span class="hljs-string">"3000"</span>
    <span class="hljs-attr">port</span>: <span class="hljs-number">3000</span>
    <span class="hljs-attr">targetPort</span>: <span class="hljs-number">3000</span>
  <span class="hljs-attr">selector</span>:
    app: web
</code></pre><blockquote>
<p>api-deployment.yaml</p>
</blockquote>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">apps/v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Deployment</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">api</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">replicas:</span> <span class="hljs-number">1</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">matchLabels:</span>
      <span class="hljs-attr">app:</span> <span class="hljs-string">api</span>
  <span class="hljs-attr">template:</span>
    <span class="hljs-attr">metadata:</span>
      <span class="hljs-attr">labels:</span>
        <span class="hljs-attr">app:</span> <span class="hljs-string">api</span>
    <span class="hljs-attr">spec:</span>
      <span class="hljs-attr">containers:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">api</span>
        <span class="hljs-comment"># etc, etc</span>
</code></pre>
<blockquote>
<p>api-service.yaml</p>
</blockquote>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Service</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">api</span>
  <span class="hljs-attr">labels:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">api</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">ports:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">"3000"</span>
    <span class="hljs-attr">port:</span> <span class="hljs-number">3000</span>
    <span class="hljs-attr">targetPort:</span> <span class="hljs-number">3000</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">api</span>
</code></pre>
<p>Fair enough, let's move on!</p>
<h2 id="heading-step-2-expose-multiple-services-under-one-nginx-server">Step 2: Expose Multiple Services Under One NGINX Server</h2>
<p>NGINX is a reverse proxy in that it proxies a request by sending it to a specified origin, fetches the response, and sends it back to the client. </p>
<p>Going back to the bit about service names being accessible to other pods in a cluster, we can setup an NGINX configuration to look something like this.</p>
<blockquote>
<p>sites-enabled/www.example.com.conf</p>
</blockquote>
<pre><code>upstream api {
  server api:<span class="hljs-number">3000</span>;
}

upstream web {
  server web:<span class="hljs-number">3000</span>;
}

server {
  listen <span class="hljs-number">80</span>;

  server_name www.example.com;

  location / {
    proxy_pass http:<span class="hljs-comment">//web;</span>
  }

  location /api {
    proxy_pass http:<span class="hljs-comment">//api;</span>
  }
}
</code></pre><p>Note how we can reference origin hosts like <code>web:3000</code> and <code>api:300</code>. Niiiice!</p>
<blockquote>
<p>nginx-deployment.yaml</p>
</blockquote>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">apps/v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Deployment</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">nginx</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">matchLabels:</span>
      <span class="hljs-attr">app:</span> <span class="hljs-string">nginx</span>
  <span class="hljs-attr">template:</span>
    <span class="hljs-attr">metadata:</span>
      <span class="hljs-attr">labels:</span>
        <span class="hljs-attr">app:</span> <span class="hljs-string">nginx</span>
    <span class="hljs-attr">spec:</span>
      <span class="hljs-attr">containers:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">nginx</span>
        <span class="hljs-attr">image:</span> <span class="hljs-string">nginx</span>
        <span class="hljs-attr">ports:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">containerPort:</span> <span class="hljs-number">80</span>
</code></pre>
<blockquote>
<p>nginx-service.yaml</p>
</blockquote>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Service</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">nginx</span>
  <span class="hljs-attr">annotations:</span>
    <span class="hljs-comment"># this part will make more sense later</span>
    <span class="hljs-attr">external-dns.alpha.kubernetes.io/hostname:</span> <span class="hljs-string">www.example.com</span>
  <span class="hljs-attr">labels:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">nginx</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">type:</span> <span class="hljs-string">LoadBalancer</span>
  <span class="hljs-attr">ports:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">"80"</span>
    <span class="hljs-attr">port:</span> <span class="hljs-number">80</span>
    <span class="hljs-attr">targetPort:</span> <span class="hljs-number">80</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">nginx</span>
</code></pre>
<p>...and, we're done! Right? In my experience, initially I thought so. The <code>[LoadBalancer](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/)</code> provides an externally-accessible IP. You can confirm by running <code>kubectl get svc</code> and sure enough you'll find a host name listed in the <code>EXTERNAL-IP</code> column. </p>
<p>Assuming you've acquired a domain from a provider that offers an interface to manage DNS settings, you could simply add this URL as a <code>CNAME</code> and you're good, right? Well, kinda... but not so much.</p>
<p>Kubernetes Pods are considered to be relatively ephemeral (rather than durable) entities. Find more on this in "<a target="_blank" href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/">Pod Lifecycle - Kubernetes</a>". </p>
<p>With that said, anytime a significant change has been made in the lifecycle of a service, in our case the NGINX app, we will have a different IP address which will in turn cause significant downtime in our app which defeats a main purpose of Kubernetes - to help establish a "highly available" application. </p>
<p>Okay, don't panic - we'll get through this ?</p>
<h2 id="heading-step-3-create-an-external-dns-service-to-dynamically-point-nginx">Step 3: Create an External DNS Service to Dynamically Point NGINX</h2>
<p>In the previous step, with our <code>LoadBalancer</code> spec coupled with EKS we actually created an <a target="_blank" href="https://aws.amazon.com/elasticloadbalancing/">Elastic Load Balancer</a> (for better or worse). </p>
<p>In this section we'll create a DNS service that points our load balancer via "ALIAS record". This ALIAS record is essentially dynamic in that a new one is created whenever our service changes. The stability is established in the name server records.</p>
<p>The tl;dr for the remaining portion is simply follow the <a target="_blank" href="https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md">documentation for using ExternalDNS with Route 53</a>. Route 53 is "<a target="_blank" href="https://aws.amazon.com/route53/">cloud Domain Name System (DNS) web service</a>". </p>
<p>Below were things I had to do that weren't obvious from the documentation. Hold on to your horses, this gets a little scrappy.</p>
<ul>
<li><code>eksctl utils associate-iam-oidc-provider --cluster=your-cluster-name</code> per <a target="_blank" href="https://eksctl.io/usage/iamserviceaccounts/"><code>eksctl</code> service accounts documentation</a>.</li>
<li>When creating the IAM policy document per the <a target="_blank" href="https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#iam-policy">ExternalDNS documentation</a>, I actually had to do it via CLI vs online in my account. I kept getting this error: <code>WebIdentityErr: failed to retrieve credentials\ncaused by: AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity\n\tstatus code: 403</code>. When I created the policy via CLI the issue went away. Below is the full command you should be able to literally copy and execute if you have the <a target="_blank" href="https://aws.amazon.com/cli/">AWS CLI</a> installed.</li>
</ul>
<pre><code>aws iam create-policy \
  --policy-name AllowExternalDNSUpdates \
  --policy-<span class="hljs-built_in">document</span> <span class="hljs-string">'{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["route53:ChangeResourceRecordSets"],"Resource":["arn:aws:route53:::hostedzone/*"]},{"Effect":"Allow","Action":["route53:ListHostedZones","route53:ListResourceRecordSets"],"Resource":["*"]}]}'</span>
</code></pre><ul>
<li>Use the policy ARN output above to create an IAM role bound to the ExternalDNS service account with a command that will look something like <code>eksctl create iamserviceaccount --cluster=your-cluster-name --name=external-dns --namespace=default --attach-policy-arn=arn:aws:iam::123456789:policy/AllowExternalDNSUpdates</code>.</li>
<li>We should now have a new role from the above that we can see in the <a target="_blank" href="https://console.aws.amazon.com/iam">IAM console</a> which will have a name of something like <code>eksctl-foo-addon-iamserviceaccount-Role1-abcdefg</code>. Click on the role from the list and at the top of the next screen make note of the "Role ARN" as something like <code>arn:aws:iam::123456789:role/eksctl-foo-addon-iamserviceaccount-Role1-abcdefg</code>.</li>
<li>Follow <a target="_blank" href="https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#set-up-a-hosted-zone">these steps</a> to create a "hosted zone" in Route 53.</li>
<li>You can confirm things in the <a target="_blank" href="https://console.aws.amazon.com/route53">Route 53 console</a>.</li>
<li>If your domain provider allows you to manage DNS settings, add the 4 name server records from the output of the command you ran to create a "hosted zone".</li>
<li>Deploy ExternalDNS by following <a target="_blank" href="https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#deploy-externaldns">the instructions</a>. Afterwards, you can tail the logs with <code>kubectl logs -f name-of-external-dns-pod</code>. You should see a line like this at the end: <code>time="2020-05-05T02:57:31Z" level=info msg="All records are already up to date"</code></li>
</ul>
<p>Easy, right?! Okay, maybe not... but at least you didn't have to figure all of that out alone ? There could be some gaps above, but hopefully it helps guide you through your process.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Although this post may have some grey areas, if it helps you establish dynamic DNS resolution as part of a highly available application, you've got something really special ?</p>
<p>Please add comments if I can help clear up anything or correct my terminology!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Point your Domain to an S3 Website Bucket ]]>
                </title>
                <description>
                    <![CDATA[ By Clark Jason Ngo If you're hosting a static website in an S3 bucket and it's your first time buying a domain name, this simple guide is for you. Summary - What You Need Amazon S3 Have an S3 bucket with the same name as your domain name Upload your... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/cjn-how-to-point-your-domain-to-s3-website-bucket/</link>
                <guid isPermaLink="false">66d45e103a8352b6c5a2aa1b</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ S3 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Hosting ]]>
                    </category>
                
                    <category>
                        <![CDATA[ website development, ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 21 Mar 2020 00:08:34 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/03/domain_name_point_to_s3_bucket.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Clark Jason Ngo</p>
<p>If you're hosting a static website in an S3 bucket and it's your first time buying a domain name, this simple guide is for you.</p>
<h2 id="heading-summary-what-you-need">Summary - What You Need</h2>
<h3 id="heading-amazon-s3">Amazon S3</h3>
<ul>
<li>Have an S3 bucket with the same name as your domain name</li>
<li>Upload your website's code</li>
<li>Allow public access</li>
<li>Add a policy to enable S3 GetObject</li>
<li>Enable static website hosting</li>
</ul>
<h3 id="heading-domain-name-provider">Domain Name provider</h3>
<ul>
<li>In your domain name's DNS Zone settings, delete all <strong>A</strong> records</li>
<li>In DNS Zone settings, add <em>www</em> to <strong>subdomain</strong> and the S3 endpoint in hostname for <strong>CNAME</strong> records</li>
</ul>
<p>Let's go through these steps one by one.</p>
<h2 id="heading-step-1-create-an-s3-bucket">Step 1: Create an S3 bucket</h2>
<p>Create an S3 bucket to host your files for your website</p>
<p>First you need to create a bucket for your website. The name for your bucket must be the same as your domain name. Let's say we bought the domain name <strong>www.clarkngo.net</strong>. Then my S3 bucket's name should be <strong>www.clarkngo.net</strong> as well. </p>
<p>After configuration, my endpoint should look similar to this:</p>
<p>http://www.clarkngo.net.s3-website-us-west-2.amazonaws.com</p>
<p>Go to your AWS console and login. Choose S3.</p>
<ol>
<li>Click <strong>Buckets</strong></li>
<li>Click <strong>Create bucket</strong></li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-119.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li><p>Add your domain name in the <strong>bucket name</strong></p>
</li>
<li><p>You may choose any <strong>Region</strong></p>
</li>
</ol>
<h3 id="heading-creating-the-s3-bucket-and-general-configuration">Creating the S3 bucket and general configuration</h3>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-118.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Follow the checkboxes below and click <strong>Create Bucket</strong>.</p>
<p>Only tick the following:</p>
<ul>
<li><strong>Block public access to bucket and objects granted through <em>new</em> access control lists (ACLs)</strong></li>
<li><strong>Block public access to bucket and objects granted through <em>any</em> access control lists (ACLs)</strong></li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-120.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-uploading-files-to-the-s3-bucket">Uploading files to the S3 Bucket</h3>
<ol>
<li>Click <strong>Overview</strong> and <strong>Upload</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-121.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Upload your website files in <strong>Select Files</strong></li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-122.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li><p>For <strong>Set permissions</strong>, hit <strong>Next</strong>.</p>
</li>
<li><p>For <strong>Set properties</strong>, hit <strong>Next</strong>. (The default is Standard S3.)</p>
</li>
<li><p>For <strong>Review</strong>, hit <strong>Upload</strong>.</p>
</li>
</ol>
<h3 id="heading-editing-the-bucket-policy">Editing the Bucket Policy</h3>
<ol>
<li>Click <strong>Permissions</strong>, then <strong>Bucket Policy</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-123.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Add the policy. (Note: For your website you'll change <strong>arn:aws::s3:::www.clarkngo.net/*</strong>)</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-124.png" alt="Image" width="600" height="400" loading="lazy"></p>
<pre><code>{
    <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
    <span class="hljs-string">"Id"</span>: <span class="hljs-string">"Policy1548223592786"</span>,
    <span class="hljs-string">"Statement"</span>: [
        {
            <span class="hljs-string">"Sid"</span>: <span class="hljs-string">"Stmt1548223591553"</span>,
            <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
            <span class="hljs-string">"Principal"</span>: <span class="hljs-string">"*"</span>,
            <span class="hljs-string">"Action"</span>: <span class="hljs-string">"s3:GetObject"</span>,
            <span class="hljs-string">"Resource"</span>: <span class="hljs-string">"arn:aws:s3:::www.clarkngo.net/*"</span>
        }
    ]
}
</code></pre><ol start="3">
<li>Hit <strong>Save</strong>.</li>
</ol>
<h3 id="heading-static-website-hosting">Static website hosting</h3>
<ol>
<li>Click <strong>Properties</strong>, then <strong>Static website hosting</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-125.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li><p>Choose <strong>Use this bucket to host a website</strong>.</p>
</li>
<li><p>For Index document, type <em>index.html</em>.</p>
</li>
<li><p>For Error document, type <em>index.html</em>.</p>
</li>
<li><p>Hit <strong>Save</strong>.</p>
</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-126.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-step-2-add-the-s3-endpoint-to-your-domain">Step 2: Add the S3 Endpoint to your Domain</h2>
<h3 id="heading-editing-your-dns-zone">Editing your DNS Zone</h3>
<ol>
<li>Login to your domain provider.</li>
<li>In this example, choose <strong>Name Servers/DNS</strong>, then <strong>Modify DNS Zone</strong> (or the equivalent).</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-127.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>Remove all <strong>A</strong> records in your domain. Usually it will have a default IP address for a 404 Not Found page.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-128.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li><p>Add a <strong>CNAME</strong> to point to the S3 Bucket:</p>
</li>
<li><p>add <strong>www</strong> for the Subdomain.</p>
</li>
<li>add <strong>www.clarkngo.net.s3-website-us-west-2.amazonaws.com</strong> (the S3 Endpoint) to the Hostname.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-129.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>And you're done! Note that it might take a while for your new settings take effect.</p>
<p>Connect with me in LinkedIn <a target="_blank" href="https://www.linkedin.com/in/clarkngo/">here</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-133.png" alt="Image" width="600" height="400" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Host your Static Website with AWS - A Beginner's Guide ]]>
                </title>
                <description>
                    <![CDATA[ When I created my first portfolio last year, I based it on what I had learned from freeCodeCamp (HTML, CSS and a little JavaScript). At that point, I had only viewed my portfolio on localhost by viewing the files on my local computer. I didn’t know a... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/a-beginners-guide-on-how-to-host-a-static-site-with-aws/</link>
                <guid isPermaLink="false">66d4608a47a8245f78752a99</guid>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ SSL ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Hosting ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Phoebe Voong-Fadel ]]>
                </dc:creator>
                <pubDate>Thu, 08 Aug 2019 11:48:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2019/08/undraw_blogging_vpvv.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When I created my first <a target="_blank" href="https://thecodinghamster.com/">portfolio</a> last year, I based it on what I had learned from <a target="_blank" href="https://www.freecodecamp.org/">freeCodeCamp</a> (HTML, CSS and a little JavaScript).</p>
<p>At that point, I had only viewed my portfolio on localhost by viewing the files on my local computer. I didn’t know anything about how to host a website online.</p>
<p>Learning how to host my first website wasn’t easy but it was a great learning experience. If you're an aspiring web developer or just interested in launching your own static website, then I hope you will find this guide useful.</p>
<h4 id="heading-who-is-this-guide-for"><strong>Who is this guide for?</strong></h4>
<p>This guide is aimed at <strong>complete beginners</strong> who want to host a static website (a site with fixed content). I will provide a how-to-guide for the following:</p>
<ol>
<li><p>How to buy a domain.</p>
</li>
<li><p>How to configure your domain for an external hosting provider.</p>
</li>
<li><p>How to host your website with Amazon Web Services (AWS).</p>
</li>
<li><p>How to make your website secure (SSL certification) using Amazon Certification Manager.</p>
</li>
</ol>
<p>There might be some terminology that’s new to you. Please go ahead and look up terms that are not familiar. I’ve put in useful links and explanations where I thought appropriate.</p>
<h4 id="heading-what-is-a-domain-name-and-dns-domain-name-system"><strong>What is a domain name and DNS (Domain Name System)?</strong></h4>
<p>A domain name is your website address. For example thecodinghamster.com. But for a computer, a domain name is actually a series of numbers (an IP address). An IP address looks like this: 123.321.0.1</p>
<p>It’s not easy for us to remember a long string of numbers. So your computer refers to a <strong>DNS</strong> to translate a text based website address into an IP address which it can then understand. A DNS is like a directory.</p>
<p>I watched this great video which explains domain name, DNS and how this works in under five minutes. Please watch the first five minutes of the video if you're interested:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/e2xLV7pCOLI" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<h3 id="heading-where-can-you-buy-your-domain-name">Where can you buy your domain name?</h3>
<p>You can buy a domain name from a domain name registrar. Prices start from a few dollars. Your domain name is unique. Each domain name registrar offers different levels of services/support. But you can register your domain with any registrar.</p>
<h4 id="heading-what-is-a-hosting-provider"><strong>What is a hosting provider?</strong></h4>
<blockquote>
<p>“An <a target="_blank" href="https://en.wikipedia.org/wiki/Internet_hosting_service">Internet hosting service</a> is a service that runs Internet servers, allowing organizations and individuals to serve content to the Internet. There are various levels of service and various kinds of services offered.”</p>
</blockquote>
<p>When I was looking for a hosting provider for my website, I explored different options. The prices ranged from £2.00 — £5.00 per month with various storage options from 0.5GB to 10GB. The prices seemed reasonable but all I wanted to do was host a static website. It had a few images, HTML, CSS and JavaScript files. No dynamic content.</p>
<h4 id="heading-why-aws"><strong>Why AWS?</strong></h4>
<p>After some further research, I found AWS. AWS offers a <a target="_blank" href="https://aws.amazon.com/free/?nc2=h_ql_pr">free tier option</a>. Essentially, you get lots of free products. Some of them expire after 12 months and others are free in perpetuity. The only cost that you will incur for hosting a static website is the cost of setting up a hosted zone. This cost $0.50 per month. So I went with AWS and set up my account.</p>
<p>The great thing about AWS is the price and it’s a reliable hosting provider. But one thing to bear in mind is that you’re reliant on their documentation. As I started reading about what services AWS offered, it quickly became confusing! I used the official AWS <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html">guide provided</a> for setting up static websites. But I found myself getting lost with clicking on a link to another link and so forth. I started researching other guides to make up for knowledge gaps.</p>
<p>I found this this excellent <a target="_blank" href="https://victoria.dev/verbose/hosting-your-static-site-with-aws-s3-route-53-and-cloudfront/">guide by Victoria Drake</a>.</p>
<p>I followed Victoria Drake’s guide alongside the AWS one and managed to muddle through. But there were still a few things that were not explained which I hope to flesh out.</p>
<p>Before we proceed, here is your to do list:</p>
<ul>
<li><p>Do some research on domain registrars and buy your domain name.</p>
</li>
<li><p>Sign up for a free account with AWS.</p>
</li>
<li><p>Have both the <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html">documentation from AWS</a> and <a target="_blank" href="https://victoria.dev/verbose/hosting-your-static-site-with-aws-s3-route-53-and-cloudfront/">Victoria Drake’s guide open</a>. Use my guide to guide you through the documentation (hope that makes sense!).</p>
</li>
</ul>
<p>Here we go!</p>
<h4 id="heading-aws-create-a-hosted-zone-on-route-53"><strong>AWS: Create a Hosted Zone on Route 53.</strong></h4>
<p>Route 53 is where all your DNS requests are handled.</p>
<p>The first thing you must set up is your hosted zone with Route 53. This is really easy if you bought your domain through AWS. A hosted zone is created automatically once you’ve purchase it. If you’ve done this then just skip to the next section (<strong>Set up your S3 Buckets</strong>).</p>
<p>However, if you were like me and bought your domain name via another registrar then please do the following.</p>
<p><strong>This next part is how to create a Hosted Zone on Route 53 if you haven’t bought your domain name from AWS:</strong></p>
<ol>
<li><a target="_blank" href="https://console.aws.amazon.com/route53/home?#hosted-zones:">Go to Route 53</a> in your console and click on “Create Hosted Zone”. Fill in your domain address, comment is optional and choose a “Public Hosted Zone”. Click on “Create”.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/hostedzone1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Once your hosted zone is created, you need your NS (Name Servers) records:</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/hostedzone2-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>Go to your domain name registrar and login. Depending on your registrar, you should find a section in your settings called "Nameservers" which you can edit. You need to copy across the AWS NS records and change the existing NS records in your domain settings.</li>
</ol>
<p>Please note, don't copy the full stop/period at the end of the NS record. For example, is should be “ns-63.awsdns-07.com”, not “ns-63.awsdns-07.com.”</p>
<p><strong>It will take up to 24 hours to propagate.</strong></p>
<h3 id="heading-set-up-your-s3-buckets"><strong>Set up your S3 Buckets</strong></h3>
<p>In the meantime you can set up your S3 Buckets. The S3 Bucket is the storage for your files such as your index.html.</p>
<p>You must configure two buckets for your website: 1) yourdomainname.com and 2) www.yourdomainname.com.</p>
<p>The first bucket is your main bucket where you will upload all your documents, such as your index.html. The second bucket redirects to the first bucket. To set up your S3 Buckets, please follow the AWS documentation on how to set up your S3 bucket ( <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-s3-tasks">2: Create and Configure Buckets and Upload Data</a>).</p>
<p>In addition to the documentation, there are a few things to note:</p>
<ul>
<li><p>In section 2.1 (part 2): click on the link <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html">How Do I Create an S3 Bucket?</a> This is a step by step guide and explain all the settings you need to choose.</p>
</li>
<li><p>In section 2.1 (part 3): you don’t have to upload your website files yet. You can add a test index.html in the meantime.</p>
</li>
</ul>
<p>Take note of your <strong>endpoint</strong>. You can find this in your S3 bucket &gt; “Properties” tab &gt; “Static Web Hosting” box. It should look something like this: http://yourdomainname.com.s3-website.eu-west-2.amazonaws.com</p>
<h3 id="heading-add-the-aliasa-records-in-route-53"><strong>Add the Alias/“A” records in Route 53</strong></h3>
<p>Finally go back to Route 53 and open your hosted zone to set up your Alias records. You can follow <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-add-arecord-to-hostedzone">the documentation</a> on “Step 3: Add Alias Records for example.com and www.example.com”. It is quite straightforward.</p>
<p>Once the NS settings have propagated, <strong>your site is live</strong>! You’ll be able to visit your site at the domain address e.g. yourdomainname.com</p>
<p>However, please note that it won’t be secure and you’ll see a <strong>http://</strong> prefix in the address bar. I’ll get to that in the next section.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/undraw_security_o890.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-make-your-website-secure-and-what-is-a-ssl-certificate"><strong>How to make your website secure and what is a SSL certificate?</strong></h3>
<p>It’s very important to make your website secure and to do this you’ll need to get an SSL certificate. SSL stands for <a target="_blank" href="https://en.wikipedia.org/wiki/Transport_Layer_Security">Secure Sockets Layer</a> and it uses encryption to securely transfer data between a user and site. Google will also give a rankings boost for websites with HTTPS.</p>
<p>If you secure the website with an SSL certificate, you’ll see <strong>https://</strong> and a padlock symbol in your address bar.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-19-at-01.05.23.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>There are different types of SSL certificates: <a target="_blank" href="https://en.wikipedia.org/wiki/Extended_Validation_Certificate">Extended Validation Certificate</a> and a <a target="_blank" href="https://en.wikipedia.org/wiki/Domain-validated_certificate">Domain validated certificate</a>. For a personal website or blog, only a domain validated certificate is required. You also won’t see the name of your company on the left of the bar like the example above. You only get this if you have an Extended Validation Certificate which is more for large companies/enterprises.</p>
<h3 id="heading-how-much-does-it-cost-for-an-ssl-certificate"><strong>How much does it cost for an SSL certificate?</strong></h3>
<p>I’ve seen a range of ways of getting an SSL certificate. You can pay a premium for a service that will do this on your behalf or you can do it for free with <a target="_blank" href="https://letsencrypt.org/getting-started/">Let’s Encryp</a>t. Let’s Encrypt is an official Certificate Authority (CA). But you have to renew your certificate every three months and the process is quite complicated.</p>
<p>I didn’t want to pay a premium or want the hassle of renewing every three months. Conveniently, AWS can issue SSL certificates for a <a target="_blank" href="https://aws.amazon.com/certificate-manager/pricing/">very small fee</a>. You pay $0.75 for each certificate issued and it lasts for one year.</p>
<p>If you choose not to go with AWS, make sure you do your research and choose a <a target="_blank" href="https://www.geckoandfly.com/24460/free-trusted-ssl-certificate/">trusted CA</a>!</p>
<h3 id="heading-how-do-you-get-an-ssl-certificate-with-aws"><strong>How do you get an SSL certificate with AWS?</strong></h3>
<p>Log into your AWS console and navigate to the <a target="_blank" href="https://aws.amazon.com/certificate-manager/">AWS Certificate Manager</a> (ACM).</p>
<p><strong>Make sure you change the region from the default (Ohio) to N. Virginia.</strong> This is not explicit in the guides and only the N. Virginia region can issue certificates. I learned the hard way and wasted a lot of time!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-19-at-01.23.52.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then click on “Get Started” under “Provision Certificates”.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-18-at-14.55.14.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Follow the <a target="_blank" href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html">documentation with AWS</a> (“Requesting a public certificate using the console”) and use <a target="_blank" href="https://vickylai.com/verbose/hosting-your-static-site-with-aws-s3-route-53-and-cloudfront/">Victoria Drake’s guide</a> (under “SSL certificate”).</p>
<p><strong>In addition to the guides</strong> there are few things that weren’t fully explained:</p>
<ul>
<li><p>You’ll need to <strong>validate your domain ownership</strong> by email or directly with DNS. I would suggest to always verify ownership by <a target="_blank" href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html"><strong>DNS validation</strong></a>.</p>
</li>
<li><p>Once you’ve requested your certificate you’ll get something like this (except the status will be pending). Click on the “Export DNS Configuration file”:</p>
</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/acm.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>It’s an Excel spreadsheet which will contain something like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-18-at-15.28.11.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li><p>You’ll need to add these records to your DNS settings with your registrar. Log in and go to DNS settings. The interface varies with different registrars but you’re looking for your Host records under your DNS settings.</p>
</li>
<li><p>Click on “Add Record” &gt; record type is <strong>CNAME</strong>:</p>
</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-18-at-15.48.11.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You need to add two records: 1) Hostname should be “@” and Target Name should be the Record value from the DNS configuration file.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-18-at-16.01.07.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Hostname should be * (asterisk) and Target Name should be the Record value from the DNS configuration file.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-18-at-16.01.31.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If you want more information about the CNAME and record types, I found this <a target="_blank" href="https://help.hover.com/hc/en-us/articles/217282457-How-to-Edit-DNS-records-A-AAAA-CNAME-MX-TXT-SRV-">helpful article</a>.</p>
<p>It's quite long, but I've pulled out the useful part:</p>
<blockquote>
<p>“Note: Hostname refers to the prefix before the domain name. To create a Blank record, use an @ in the Hostname field. This represents an empty prefix (so the name exactly matches the domain name; for example divapirate.com). The @ hostname is also referred to as the the root of the domain. An * (asterisk) in the Hostname is a wildcard, and represents any prefix. For example, creating a record for *.divapirate.com will point .divapirate.com at the IP address provided.”</p>
</blockquote>
<p>You just need to wait for the verification. For me, this took about an hour.</p>
<h3 id="heading-how-do-you-add-your-ssl-certificate"><strong>How do you add your SSL certificate?</strong></h3>
<p>With AWS you can add SSL certificate to your website through setting up <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-cloudfront-walkthrough.html"><strong>CloudFront</strong></a>. CloudFront is great for speeding up your website. I used the <a target="_blank" href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html">AWS documentation</a> and <a target="_blank" href="https://victoria.dev/verbose/hosting-your-static-site-with-aws-s3-route-53-and-cloudfront/">Victoria Drake’s guide</a> (look out for her useful tips).</p>
<p>Please note, when you create your CloudFront distribution, there’s a drop down menu to add your SSL certificate. If you have been issued with an SSL certificate already, it will be pre-populated in the drop down menu.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/Screen-Shot-2019-01-19-at-01.36.02-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Your state in your CloudFront dashboard should changed to “Enabled”. This isn’t instant and takes a little time.</p>
<h3 id="heading-almost-there"><strong>Almost there…</strong></h3>
<p>Finally, you need to get your <strong>Domain Name</strong> from the CloudFront distribution. It should be something like this dsfdser83543.<strong>cloudfront.net</strong>.</p>
<p>Go back to Route 53 &gt; hosted zone &gt; change both Alias records (Alias Target) to the CloudFront Domain Name.</p>
<p>Voila! You have hosted your first <strong>secure static website</strong> with AWS.</p>
<hr>
<p>Hope you found this useful. If you have any questions or just want to say hello, find me on Twitter <a target="_blank" href="https://twitter.com/PhoebeVF">@PhoebeVF</a></p>
<p>A big thank you to Victoria Drake for her guide. For a more advanced tutorial on this topic, please check out Victoria's article: <a target="_blank" href="https://victoria.dev/verbose/hosting-your-static-site-with-aws-s3-route-53-and-cloudfront/">"Hosting your static site with AWS S3, Route 53, and CloudFront"</a>.</p>
<p>Illustrations courtesy of <a target="_blank" href="https://undraw.co/">https://undraw.co</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What happens when you click on a URL in your browser ]]>
                </title>
                <description>
                    <![CDATA[ By Anchal Nigam In this article, I want my readers to get a picture of a very basic concept of the web world. Previously, I've written articles on the fancy stuff of today’s market, i.e. Angular journey, basics of react, etc. But, today, I want my re... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-happens-when-you-hit-url-in-your-browser/</link>
                <guid isPermaLink="false">66d45da1246e57ac83a2c705</guid>
                
                    <category>
                        <![CDATA[ Browsers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ internet ]]>
                    </category>
                
                    <category>
                        <![CDATA[ url ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 30 Jun 2019 08:06:27 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2019/06/browser.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Anchal Nigam</p>
<p>In this article, I want my readers to get a picture of a very basic concept of the web world. Previously, I've written articles on the fancy stuff of today’s market, i.e. <a target="_blank" href="https://www.freecodecamp.org/news/angular-a-journey-into-one-of-the-most-popular-front-end-tools-in-todays-job-market/">Angular journey</a>, <a target="_blank" href="https://www.freecodecamp.org/news/start-your-journey-into-the-world-of-react-by-learning-these-basics-d6e05d3655e3/">basics of react,</a> etc. But, today, I want my readers to get into the journey which they encounter at first when they hit any URL. </p>
<p>As the topic is self explanatory - <strong>when we hit any URL then what happens?</strong> - let’s start!</p>
<p>Before discussing <strong>what happens after hitting the URL</strong>, we must go through what a URL actually is, and what different parts of the URL mean - right? Without wasting any time, let’s understand more about URLs.</p>
<h2 id="heading-url-uniform-resource-locator">URL – Uniform Resource Locator</h2>
<p>If you look into its full form, then it is self explanatory: it has the location of the resources which we want to access. It is an <strong>address of the place</strong> where we want to go to interact with or find information. </p>
<p>Let's look into your daily life. If you want to visit your friend’s house for some work or to get information, you need their address. The same thing goes here in this big web world: we have to give an address of the website which we want to access. The <strong>web site is like the house and the URL is the address.</strong></p>
<h3 id="heading-anatomy-of-a-url">Anatomy of a URL</h3>
<p>Now, we know what a URL is but we still don’t know about the parts of a URL. Let’s go!</p>
<p>Let’s take an example:</p>
<p><a target="_blank" href="https://www.example.com/page1">https://www.example.com/page1</a></p>
<p>Here, the first part is <strong>‘https’</strong>. This basically tells the browser which protocol it should use. It can be <strong>http, https, ftp,</strong> etc. A <strong>protocol</strong> is a <strong>set of rules</strong> that browser use for communication over the network. <strong>'https'</strong> is basically a <strong>secure version</strong>, i.e. information is exchanged in a secure way.</p>
<p>The second part <strong>www.example.com</strong> is a <strong>domain name</strong>. You can relate it to your friend’s house. It is an address of website. We use it to reach to the server (trained computer) that is responsible for serving the information for that website. Wait! You might think, a seconds before I mentioned URL is the address whereas I also mentioned domain name is also address. You may have been confused. Don’t be confused!</p>
<h3 id="heading-difference-between-url-and-domain-name">Difference between URL and Domain Name</h3>
<p>The major difference between both is that the <strong>URL is a complete address</strong>. URL tells about the method through which information should exchange, the path after reaching that website. Whereas the <strong>domain name is part of a URL</strong>. </p>
<p>Let’s take our previous example to better understand. You can say that your friend’s house address is a domain name, whereas the URL not only tells the friend’s house address (domain name) but also how you are going to communicate like talking in a separate room (secure) or in front of everyone (info can get leak). It also tells the path, i.e. at which part of the house you will go after entering into the house. Hence, the domain name is part of the URL. A domain name with more information is a URL. </p>
<p>I hope now you are clear with the URL. Let’s get into the next part.</p>
<h2 id="heading-domain-name">Domain Name</h2>
<p>In the previous part, I explained about domain names, but not in depth. I want you to go into it more. As I told you, the Domain name is the address of the website. It gives a <strong>unique identity</strong> to your <strong>website</strong> in such a huge web world. No two domain names can be the same BUT - Yes! There is ‘but’. This is not the only definition of a domain name. There is another story behind it. Let’s get into that story.</p>
<p>As we know, when we hit any URL or you can say domain name, then that website gets opened with its content. A server (a trained computer) serves it. We also know that every computer has an IP address which is used for communication over the internet. It is an address as its self explaining ‘IP address’. When we <strong>hit</strong> any <strong>URL,</strong> then we are actually <strong>hitting</strong> the <strong>IP address</strong> of the computer which is responsible for serving the website content (hosting). </p>
<p>But, now, you might think what the hell...is everything an address? Why does this domain name exist if the IP address is there? Why can’t we use IP address to get content of the website? </p>
<p>Yes! You can <strong>use IP addresses</strong> to <strong>get content</strong> of the website but really!.. Would you be able to remember each website’s associated IP address? Obviously not! It’s <strong>hard</strong> to <strong>remember the IP address</strong> of every website. That’s why domain names came into the market.</p>
<p>You can relate it to your contact list. You can’t remember every person’s number, but you can remember their name. Same concept applies here as well. You <strong>can’t remember</strong> those scary <strong>IP addresses</strong>, but you can easily <strong>remember</strong> <strong>domain names</strong>. </p>
<p>This huge amount of data is maintained in a database where the domain name with its IP address is stored. A system that stores domain names with its corresponding IP address is known as <strong>DNS (Domain name system)</strong> (I believe you must have heard about it).</p>
<p>I think I have discussed enough basics. Now, get a deep dive into the process of when we hit any URL.</p>
<h2 id="heading-dns-lookup-to-find-ip-address">DNS lookup to find IP address</h2>
<p>After hitting the URL, the first thing that needs to happen is to resolve IP address associated with the domain name. DNS helps in resolving this. <strong>DNS is like a phone book</strong> and <strong>helps us to provide the IP address</strong> that is associated with the domain name just like our phone book gives a mobile number which is associated with the person’s name.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/06/dns.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This is the overview, but there are <strong>four layers</strong> through which this domain name query goes through. Let’s understand the steps: </p>
<ol>
<li><p>After hitting the URL, the <strong>browser cache</strong> is checked. As browser maintains its DNS records for some amount of time for the websites you have visited earlier. Hence, firstly, DNS query runs here to find the IP address associated with the domain name. </p>
</li>
<li><p>The second place where DNS query runs in <strong>OS cache</strong> followed by <strong>router cache</strong>.</p>
</li>
<li><p>If in the above steps, a DNS query does not get resolved, then it takes the help of resolver server. Resolver server is nothing but your ISP (Internet service provider). The query is sent to ISP where DNS query runs in <strong>ISP cache.</strong></p>
<ol start="4">
<li>If in 3rd steps as well, no results found, then request sends to <strong>top or root server</strong> of the DNS hierarchy. There it never happens that it says no results found, but actually it tells, from where this information you can get. If you are searching IP address of the top level domain (.com,.net,.Gov,. org). It tells the resolver server to search <strong>TLD server</strong> (Top level domain).</li>
</ol>
</li>
<li><p>Now, resolver asks TLD server to give IP address of our domain name. TLD stores address information of domain name. It tells the resolver to ask it to <strong>Authoritative Name server.</strong> </p>
</li>
<li><p>The authoritative name server is responsible for knowing everything about the domain name. Finally, resolver (ISP) gets the IP address associated with the domain name and sends it back to the browser.</p>
</li>
</ol>
<p>After getting an IP address, resolver stores it in its cache so that next time, if the same query comes then it does not have to go to all these steps again. It can now provide IP address from their cache. </p>
<p>This is all about the steps that is followed to resolve IP address that is associated with the domain name. Have a look below to better understand:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/06/dns_resolve.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-tcp-connection-initiates-with-the-server-by-browser">TCP connection initiates with the server by Browser</h2>
<p>Once the <strong>IP address</strong> of the computer (where your website information is there) is <strong>found</strong>, it <strong>initiates connection</strong> with it. To communicate over the network, <strong>internet protocol</strong> is followed. <strong>TCP/IP</strong> is most common protocol. A connection is built between two using a process called <strong>‘TCP 3-way handshake’</strong>. Let’s understand the process in brief:</p>
<ol>
<li><p>A client computer sends a <strong>SYN message</strong> means, whether second computer is open for new connection or not. </p>
</li>
<li><p>Then <strong>another computer</strong>, if open for new connection, it sends <strong>acknowledge message</strong> with SYN message as well. </p>
</li>
<li><p>After this, <strong>first computer</strong> receives its message and acknowledge by <strong>sending</strong> an <strong>ACK message.</strong></p>
</li>
</ol>
<p>To better  understand, look below diagram.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/06/process.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-communication-starts-request-response-process">Communication Starts (Request Response Process)</h2>
<p>Finally, the connection is built between client and server. Now, they both can communicate with each other and share information. After successful connection, <strong>browser (client)</strong> sends a <strong>request</strong> to a <strong>server</strong> that I want this content. The server knows everything of what response it should send for every request. Hence, the <strong>server responds back.</strong> This response contains every information that you requested like web page, status-code, cache-control, etc. Now, the browser renders the content that has been requested.</p>
<p>That’s it! All the above process happens when we hit any URL. Although this lengthy process takes less than seconds to complete. This is the answer to your question <strong>‘what happens when we hit any URL in a browser?’</strong></p>
<p>Thanks for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ An introduction to the Domain Name System ]]>
                </title>
                <description>
                    <![CDATA[ By Sumedh Nimkarde You all might have heard about or know about the Domain Name System (DNS) if you understand how the internet works or how computer networks work. If you aren’t familiar with DNS, I would recommend that you go and check out my previ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/understanding-the-domain-name-servers-46c6bcf9afa3/</link>
                <guid isPermaLink="false">66c363feb737bb2ce70731fa</guid>
                
                    <category>
                        <![CDATA[ computer network ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ internet ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 23 Feb 2019 09:14:51 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*DlTgMe5CZ5BfICp6i42f-g.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Sumedh Nimkarde</p>
<p>You all might have heard about or know about the Domain Name System (DNS) if you understand how the internet works or how computer networks work. If you aren’t familiar with DNS, I would recommend that you go and check out my previous blog post which is focused on computer networks <a target="_blank" href="https://medium.freecodecamp.org/computer-networks-and-how-to-actually-understand-them-c1401908172d">here</a>.</p>
<p>Hostnames alone cannot tell us where the particular machine/hardware that we are trying to communicate with is located in the world. Hence, all communication is done with IP addresses.</p>
<p>Domain Name Servers are the devices that map the hostname to the IP addresses of the machine/hardware on which your services are running.</p>
<p>In this post, I will be explaining in detail the types of DNS queries, types of DNS servers, and types of DNS records.</p>
<h3 id="heading-dns-resolver">DNS Resolver</h3>
<p>DNS Resolvers are the computers used by Internet Service Providers (ISPs) to perform lookups in their database for the particular hostname requested by the user. They then redirect that user to the mapped IP address. They play a vital role in DNS Resolution.</p>
<p>DNS Resolvers also cache the data. So for example, my website<code>example.com</code> is currently hosted on a machine with the IP address <code>35.195.226.230</code> . So, the caches of the DNS Resolvers all over the world have mapped the following:</p>
<p><code>example.com</code> -&amp;g<code>t; 35.195.226.</code>230</p>
<p>Consider, in the future, if I want to host my website on any another server across the world with an IP of, say, <code>35.192.247.235</code>. The DNS caches of all the DNS Resolvers across the world will still have the old IP address for some time. This may lead to unavailability through conventional means of the website until the DNS propagation happens completely.</p>
<p>The record in the DNS Resolver cache remains there for some time, which is called time to live (TTL for short).</p>
<p>This is the time a record is cached in the DNS Resolver. This can be set in the registrar’s dashboard from where you have purchased the domain.</p>
<p>Note: from now on, I will refer to the DNS Resolver as Resolver only in this blog post.</p>
<h3 id="heading-types-of-dns-servers">Types of DNS servers</h3>
<h4 id="heading-root-dns-server"><strong>Root DNS server</strong></h4>
<p>The Root DNS servers are the ones who have the addresses of all the TLD domain servers. A request first encounters the Root DNS servers while on its journey to obtain the IP address from the hostname.</p>
<p>There are 13 root domain name servers across the world as of 2016. This does not mean that there are only 13 machines handling the load of the requests coming from all over the world — there are multiple servers at ground level handling the load.</p>
<p>Different organizations manage the Root DNS servers:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/B3BTLHU-knwsZx4JFN91eiiBt-vlJvaepjeS" alt="Image" width="682" height="424" loading="lazy">
<em>Credits: https://iana.org</em></p>
<h4 id="heading-tld-domain-server"><strong>TLD domain server</strong></h4>
<p>These are the ones classified according to the Top-Level Domain. They are usually the next ones which the iterative query hits after the Root DNS server. They store the TLD specific records for the hostname.</p>
<p>Let’s say if we are requesting an IP address of <code>medium.com</code> , then the TLD domain servers for “.com” TLD are queried. The TLD domain servers return the address of the Authoritative DNS servers to the Resolver.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/dY2lnrWhjllbEIQl9Wy7TwUxtwYLi7AsGX-R" alt="Image" width="552" height="474" loading="lazy">
<em>Fig. TLD Name servers pointing to the Authoritative Name servers</em></p>
<p>Now, the question arises: how does the TLD name server know the address of the Authoritative Name server? The answer is simple: when you purchase any domain with the registrars like Godaddy or Namecheap, the registrars also communicate the domains to the TLD name server. So it is able to contact the Authoritative Name servers.</p>
<p>Nowadays, some of the registrars provide the ability to use third party Authoritative Name servers. As shown in the above figure, you can set up the Authoritative Nameservers in the registrar’s dashboard.</p>
<h4 id="heading-authoritative-dns-server"><strong>Authoritative DNS server</strong></h4>
<p>These are queried iteratively in the end by the Resolver. They store the actual records for type A, NS, CNAME, TXT, etc.</p>
<p>Thus, they return the IP address of the hostname if available. If it is not available even in the Authoritative DNS server, then they throw an error with the particular message and the process of searching IP addresses across the Nameserver ends.</p>
<h3 id="heading-types-of-dns-queries">Types of DNS queries</h3>
<p>There are three types of DNS queries:</p>
<p><strong>Recursive</strong>: Recursive queries are made by users to the Resolver. It is actually the first query made while doing any DNS lookup.</p>
<p>The Resolvers can be your ISP or your network admin, but usually, it is the ISP in almost all cases.</p>
<p><strong>Non-recursive:</strong> in non-recursive queries, the Resolver knows the answer and responds immediately without making any further queries to any other name servers. This happens because the local DNS server has the IP address stored in its local cache or it just queries the Authoritative name servers directly. They happen to definitely hold the record and this eventually avoids the recursive queries.</p>
<p><strong>Iterative</strong>: Iterative queries happen when the Resolver cannot return the results since they may not have cached it. So, it makes a request to the Root DNS server. And the Root DNS servers know where to find the particular TLD domain server.</p>
<p>So, for example, if we are trying to obtain the IP address for say <code>medium.com</code> , then the Root domain server will have the address of the <code>.com</code> TLD server stored in it and will then send it back to the Resolver. The Resolver then asks the TLD server for the IP address. The TLD domain server may not know it, but it knows the address of the Authoritative DNS server for <code>medium.com</code> .</p>
<p>Okay, enough of the theory. Let’s understand it by a flow diagram:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/5U6XICe32XPfFiNDXob5e6tM1EzcIJE7tV7i" alt="Image" width="693" height="731" loading="lazy">
<em>Fig. DNS Resolution</em></p>
<p>Let’s break down the above diagram in steps:</p>
<ol>
<li>The user makes a request to the Resolver with the hostname for which it wants the IP address. This is a recursive query.</li>
<li>The Resolver does a lookup in its cache to see if it is present in it.</li>
<li>If it is, it returns it back to the user.</li>
<li>If it does not have it cached, it makes an iterative request to the Root DNS servers that are present globally. As of 2016, there are 13 Root DNS servers named from A — M. Now, the Root DNS server looks up for the TLD of the requested domain. For example, if the hostname is <code>medium.com</code> , then the TLD becomes “.com” and the Root DNS server has the entry for “.com” domain servers and it returns the results back to the Resolver. The Resolver must have the addresses of all the Root domain name servers. If it doesn’t, the DNS lookup may fail in the first place.</li>
<li>Now, the Resolver again makes an iterative request to the TLD domain server asking for the IP address of the domain. The TLD domain server then returns back the address of the Authoritative server for the requested domain.</li>
<li>As of now, I believe, you may understand what are Authoritative DNS servers. They contain the actual records where the hostname is mapped to the IP address and hence the IP address is returned back to the Resolver (which in turn returns it back to the user).</li>
<li>If no matching record is found in the Authoritative Name servers, then an error with a message saying “DNS_PROBE_FINISHED_NXDOMAIN” is thrown indicating there is no record for the requested hostname.</li>
<li>In all the Nameservers the request passes through, the results for the requested hostname are cached so that when any other user requests the same domain, the record will already be present in the DNS cache.</li>
<li>All in all, it takes at the max four queries to perform the DNS lookup. But, it hardly takes a few milliseconds to perform the lookup.</li>
</ol>
<h4 id="heading-the-concept-of-dns-propagation"><strong>The concept of DNS Propagation</strong></h4>
<p>Consider, you have your website hosted with some provider like Digital Ocean on any machine with IP “x”, and you want to shift the website hosting to any other machine with different IP address say “y”. You will have to change the IP address in the Authoritative records so that traffic navigates to the new IP address.</p>
<p>Even if you update the records in your registrar’s/ name server’s dashboard, it takes some time to reflect in all the Resolvers’ caches in the world. DNS propagation can take 24–72 hours, but usually it happens sooner than that since most ISPs keep the TTL low.</p>
<p>And that’s it!</p>
<p>Thanks for reading the article. If you have any questions, please feel free to ask them in the comments below and share this post with whomever you want.</p>
<p>See you in the next one. Have a great time. Thank you.</p>
<p>You can check out my other article on Computer Networks which explains them in detail:</p>
<p><a target="_blank" href="https://medium.freecodecamp.org/computer-networks-and-how-to-actually-understand-them-c1401908172d"><strong>What computer networks are and how to actually understand them</strong></a><br><a target="_blank" href="https://medium.freecodecamp.org/computer-networks-and-how-to-actually-understand-them-c1401908172d">_Whether you are new to the world of development, or have been building things for a long time — or even if you’re a…_medium.freecodecamp.org</a></p>
<p>If you like my work, you can buy me a coffee at:</p>
<p><a target="_blank" href="http://buymeacoffee.com/lunaticmonk"><strong>Buy Sumedh Nimkarde a Coffee - BuyMeACoffee.com</strong></a><br><a target="_blank" href="http://buymeacoffee.com/lunaticmonk">_Hello, I am Sumedh and my work is to build, break and rebuild things._buymeacoffee.com</a></p>
<p>Feel free to reach out to me on <a target="_blank" href="https://twitter.com/lunatic_monk">Twitter</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ An introduction to HTTP: Domain Name System servers ]]>
                </title>
                <description>
                    <![CDATA[ By Cher Don How does the DNS work, and why is it important? Overview Throughout this series, we will be tackling the basics such as: How does DNS work? [You are here!] Network Stack, OSI Model HTTP Methods and Formats Client Identification Basic/Dig... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/an-introduction-to-http-domain-name-system-servers-b3e7060eca98/</link>
                <guid isPermaLink="false">66c34435160da468ed76f13b</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ https ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 28 Aug 2018 15:59:23 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/0*yC9oY647Pggg817o.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Cher Don</p>
<h4 id="heading-how-does-the-dns-work-and-why-is-it-important">How does the DNS work, and why is it important?</h4>
<h3 id="heading-overview">Overview</h3>
<p>Throughout this series, we will be tackling the basics such as:</p>
<ul>
<li>How does DNS work? <em>[You are here!]</em></li>
<li><a target="_blank" href="https://medium.freecodecamp.org/an-introduction-to-http-understanding-the-open-systems-interconnection-model-9dd06233d30e">Network Stack, OSI Model</a></li>
<li>HTTP Methods and Formats</li>
<li>Client Identification</li>
<li>Basic/Digest Authentication</li>
<li>HTTPS working with SSL/TLS</li>
</ul>
<h3 id="heading-what-is-http">What is HTTP?</h3>
<p>HyperText Transfer Protocol (HTTP) is a protocol devised by Sir Tim Berners Lee in 1989. It forms the basis for how web pages communicate from the web server to the client’s browser.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/oZPkrtifS2pYPY3NqewKvK7HZYvonNKI6gMm" alt="Image" width="800" height="450" loading="lazy">
_Sir Tim Berners Lee, the Father of World Wide Web. Photo courtesy of [CNET](https://www.cnet.com/pictures/images-berners-lee-and-the-dawn-of-the-web/" rel="noopener" target="<em>blank" title=")</em></p>
<h3 id="heading-dns-servers">DNS Servers</h3>
<p>Is the connection to the webpage established immediately after typing in the Domain Name, such as <code>medium.com</code>? <strong>Definitely not!</strong></p>
<p>Machines, unlike us, recognize the location of webpages by <em>IP Addresses</em>. These string of numbers, such as <code>104.16.121.127</code>, are more machine friendly especially since there are <em>millions</em> of domain names on the Web.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/83RTQUPnQ-3eLATrOj9ZMlzGyvkVKeM1arxS" alt="Image" width="800" height="533" loading="lazy"></p>
<p>The Domain Name System (DNS) plays a crucial role in the whole HTTP request process, as it allows us to call a webpage by typing a simple domain name, <code>www.medium.com</code> instead of <code>104.16.121.127</code> every time you want to access the site.</p>
<p>Without DNS, your brain would be filled with numbers just trying to remember the IP Addresses for every <em>single</em> website you use!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/B1llNAZ2wATRPi2bFeF3yc-xWm2trS2f5ltK" alt="Image" width="800" height="450" loading="lazy">
<em>Flow of DNS Resolution, maintained by a distributed database system</em></p>
<p>Now that we know that an IP Address is requested every time we type in the domain name, let’s find out where this request searches for the correct IP Address.</p>
<h4 id="heading-local-cache">Local Cache</h4>
<p>A cache is a block of memory for temporary storage of data that has a high probability of being used again. The first thing that happens is the DNS Resolver (residing in your computer) will check the browser’s cache, followed by the computer’s DNS cache. If you accessed the website recently, it would have the IP address cached in the system.</p>
<p>In that case, the browser can immediately call the IP Address to retrieve the webpage!</p>
<p>One thing to note here is that every cache has an expiry date, called the <em>“Time to Live” setting.</em> This setting determines how long the cache may be stored when the website is accessed. We will address how that works later on.</p>
<h4 id="heading-dns-recursor">DNS Recursor</h4>
<p>If the IP Address can’t be found in the local cache, it will then request from the DNS Recursor. The DNS Recursor is often the DNS Server of your Internet Service Provider (ISP).</p>
<p>These Internal DNS Servers have caches from websites that their clients have visited recently. Again, if the IP Address can’t be found here, it will be passed on to the next Domain Server.</p>
<h4 id="heading-root-level-domain-server">Root-Level Domain Server</h4>
<p>The Root-Level Domain Server (RLDS), or sometimes called the ‘ . ’ Name Server, is simply a <em>gatekeeper</em> for requests. It reads the request and locates the appropriate domain server to redirect to.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/UQ2ptMrZwvPMUV57NPN6UfGAR39ijFEP9kaN" alt="Image" width="400" height="194" loading="lazy"></p>
<p>As such, it plays an important role in redirection to the next layer of Domain Servers. They are dispersed all around the world to prevent malicious attacks from bringing down the World Wide Web by targeting the RLDS.</p>
<h4 id="heading-top-level-domain-server">Top-Level Domain Server</h4>
<p>The Top-Level Domain Server (TLDS) is the name server for domains that end with their specific domain suffixes such as <code>.com</code>, <code>.org</code> or <code>.io</code>. After being passed down by RLDS, this layer works in the same way as the second gatekeeper. It takes the requests and runs through its DNS Server to redirect the request to the last and final stop, the Second-Level Domain Server.</p>
<p>The number of domain names are increasing exponentially. It is impossible for the RLDS to be able to store or redirect such a sheer amount of IP Addresses. As such, it is redirected to the TLDS to diversify the processing power and memory required.</p>
<h4 id="heading-second-level-domain-server">Second-Level Domain Server</h4>
<p>This layer is where all the information is stored about the domain is accessible. This DNS Server is usually owned by the institute that is responsible for hosting your website.</p>
<p>As such, a request for the record of the domain is sent to this DNS Server. It returns the IP Address, along with other important information such as the server it is on, and the alias it has.</p>
<h4 id="heading-success">Success!</h4>
<p>The browser now receives the IP Address. It uses it to establish a connection with the host server using TCP/IP and retrieve the webpage via HTTP. We will discuss this in <a target="_blank" href="https://medium.freecodecamp.org/an-introduction-to-http-understanding-the-open-systems-interconnection-model-9dd06233d30e">Part 2</a>.</p>
<h3 id="heading-time-to-live-setting">“Time to Live” Setting</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/lNvth7uNEKVE805YmoqD9TQnylJGQ6CIm5eX" alt="Image" width="800" height="450" loading="lazy"></p>
<p>DNS Records have a Time to Live (TTL) Setting. This determines the amount of time that any of the domain servers can cache the record.</p>
<p>Caching is important. It reduces the loading time for the page, since the DNS information will have to be reacquired every time the domain name is requested. Hence, a high TTL would allow the DNS records to stay alive for a longer period of time. This allow webpages to load faster.</p>
<p><strong>Why don’t all DNS Records have a high TTL then?</strong></p>
<p>By having a high TTL, it would mean that visitors would not see changes to the DNS immediately. Visitors only see the change after the DNS Record has expired.</p>
<p>For example, if we were to change the host for this webpage, and have a high TTL, the changes would not appear on the visitors browser immediately. This might result in broken links and users not being able to access the webpage.</p>
<h3 id="heading-hostname-ip-address-relationship">Hostname — IP Address Relationship</h3>
<p>So a single domain name is attached to one IP Address?</p>
<p>The answer is yes… and no. It can be, but doesn’t have to be a one-to-one relationship.</p>
<h4 id="heading-single-hostname-multiple-ip-addresses">Single Hostname, Multiple IP Addresses</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/co7rvdbLXLjlFLhZuwVOuNHTa2fcLFoAU7X2" alt="Image" width="553" height="701" loading="lazy"></p>
<p>A single hostname such as <code>www.google.com</code> can correspond to multiple IP Addresses, to balance the load on the server since there is a significant amount of users calling on the same webpage at any one given point in time.</p>
<p>DNS Servers use a “Round Robin” method, such that all IP Addresses are equally utilized.</p>
<h4 id="heading-multiple-hostname-single-ip-address">Multiple Hostname, Single IP Address</h4>
<p>The purpose for this might be for referral links. For example, searching <code>amazon.com/products/pc</code> will show the product screen for PCs. Although <code>amazon.com/products/pc?user=cherdon</code> will also show the same webpage, any purchase would tell Amazon that I was the referrer, allowing me to gain commission from it.</p>
<p>Companies often buy multiple domains that link to the same webpage as well. For example, <code>google.com</code> and <code>google.net</code> would link you to the same search engine webpage.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>The DNS Server is very important as it stores a database for machine-friendly IP Addresses under user-friendly Domain Names. Now that we have learnt how DNS Servers work together in a distributed database, let us explore how the connection with the host server is established with the IP Address in <a target="_blank" href="https://medium.freecodecamp.org/an-introduction-to-http-understanding-the-open-systems-interconnection-model-9dd06233d30e">Part 2</a>!</p>
<p>Hi! I’m <a target="_blank" href="https://www.freecodecamp.org/news/an-introduction-to-http-domain-name-system-servers-b3e7060eca98/undefined">Cher Don</a>, currently pursuing a Major in Data Science. I’m the CTO of <a target="_blank" href="https://www.linkedin.com/company/paralegal-bot/">Paralegal Bot</a>, and you can find my website below. Thanks for reading!</p>
<p><a target="_blank" href="https://www.piqued.co"><strong>Piqued;</strong></a><br><a target="_blank" href="https://www.piqued.co">_Quality Content We offer the best content for difficult to grasp concepts. We've been there, and felt the same you do…_www.piqued.co</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Why a domain’s root can’t be a CNAME — and other tidbits about the DNS ]]>
                </title>
                <description>
                    <![CDATA[ By Dominic Fraser This post will use the above question to explore DNS, dig, A records, CNAME records, and ALIAS/ANAME records from a beginner’s perspective. So let’s get started. First, some definitions Domain Name System (DNS): the overall system ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/why-cant-a-domain-s-root-be-a-cname-8cbab38e5f5c/</link>
                <guid isPermaLink="false">66d45e5173634435aafcef8a</guid>
                
                    <category>
                        <![CDATA[ dns ]]>
                    </category>
                
                    <category>
                        <![CDATA[ internet ]]>
                    </category>
                
                    <category>
                        <![CDATA[ programing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 13 May 2018 23:00:07 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*YNkO-BfTsVJYxslNrNn8LA.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Dominic Fraser</p>
<p>This post will use the above question to explore <code>DNS</code>, <code>dig</code>, <code>A</code> records, <code>CNAME</code> records, and <code>ALIAS/ANAME</code> records from a beginner’s perspective. So let’s get started.</p>
<h3 id="heading-first-some-definitions">First, some definitions</h3>
<ul>
<li><strong>Domain Name System</strong> (DNS): the overall system for converting a human memorable domain name (example.com) to an IP address (93.184.216.34). The IP address is of a server, commonly a web server, where the files needed to display a webpage are stored.</li>
<li><strong>DNS Server</strong> (also known as a name server or nameserver): Uses DNS software to store information about domain addresses. There are several levels — those belonging to each ISP, Root (13 total worldwide), Top Level Domain (TLD, e.g. ‘.com’), and Domain level DNS Servers.</li>
<li><strong>Domain name</strong>: the domain (example) combined with the TLD (.com). The term ‘domain’ is often used synonymously with the domain name, <a target="_blank" href="https://www.domainsherpa.com/anatomy-of-a-domain-name-and-url/">though they are different</a>. When you buy a ‘domain’ from a a registrar or reseller, you buy the rights to a specific domain name (example.com), and any subdomains you want to create (my-site.example.com, mail.example.com, etc).</li>
</ul>
<h3 id="heading-high-level-query-flow">High level query flow</h3>
<p>The high-level flow of what happens when you type “example.com” into your browser can be simplified to remove the hops to the ISP, Root, and TLD DNS Servers as below:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/-Yu9MR65z19xx2TDl-6phT7soy3g3KNgjArX" alt="Image" width="800" height="162" loading="lazy">
_Simplified DNS request flow, more can be seen in a [more detailed flow](http://www.uxworld.com/?p=384" rel="noopener" target="<em>blank" title=")</em></p>
<p>A domain typically has two or more name servers, containing records relating to the domain name (example.com).</p>
<p>Many types of records can be stored, most of which can have multiple entries per type:</p>
<ul>
<li><code>A</code>: Address records that map the domain name to an IP address</li>
<li><code>CNAME</code>: Canonical Name Record. Used to alias one domain name (or subdomain name) to another. We’ll look at this in more detail later.</li>
<li><code>MX</code>: Mail eXchange records that tell email delivery agents where they should deliver your email</li>
<li><code>TXT</code>: flexible Text records, for storing strings for a variety of uses</li>
<li><code>SOA</code>: singular Start of Authority record kept at the top level of the domain. Contains specific required information about the domain, for example its primary name server</li>
<li><code>NS</code>: The name servers associated with the domain</li>
</ul>
<p>When your device sends a query that reaches a name server, the server looks in the domain’s record node for an <code>A</code> record, and the associated stored IP address (example.com: 93.184.216.34). This is then returned to the device, to be used to send a request to the correct web server to retrieve the requested webpage or resource.</p>
<h3 id="heading-using-dig">Using ‘dig’</h3>
<p><code>dig</code> (<strong>domain information groper</strong>) is a command-line tool for querying DNS servers. This command is generally used for troubleshooting, or as now to understand more about the setup of a system.</p>
<p><code>$ dig example.com</code> results in a long response printed to the terminal, the <a target="_blank" href="https://www.madboa.com/geek/dig/#understanding-the-default-output">default output detailed here</a>, of which we are interested in the <code>ANSWER SECTION</code>.</p>
<pre><code>;; ANSWER SECTION:
example.com.       <span class="hljs-number">72703</span>      IN     A       <span class="hljs-number">93.184</span><span class="hljs-number">.216</span><span class="hljs-number">.34</span>
</code></pre><p>And there we go, we can see that <code>example.com</code> returns an <code>A</code> record of <code>93.184.216.34</code>. Sometimes domains will have more than one <code>A</code> record, if more than one web server can provide the information needed.</p>
<p>There’s more! If we try out some other examples, we can soon see that another common record appears: <code>CNAME</code>.</p>
<p><code>$ dig www.skyscanner.net</code>:</p>
<pre><code>;; ANSWER SECTION:
www.skyscanner.net. <span class="hljs-number">169</span> IN CNAME www.skyscanner.net.edgekey.net.
www.skyscanner.net.edgekey.net. <span class="hljs-number">5639</span> IN CNAME e11316.a.akamaiedge.net.
e11316.a.akamaiedge.net. <span class="hljs-number">20</span> IN A <span class="hljs-number">23.217</span><span class="hljs-number">.6</span><span class="hljs-number">.192</span>
</code></pre><pre><code>www.skyscanner.net.edgekey.net. <span class="hljs-number">5639</span> IN CNAME e11316.a.akamaiedge.net.
</code></pre><pre><code>e11316.a.akamaiedge.net. <span class="hljs-number">20</span> IN A <span class="hljs-number">23.217</span><span class="hljs-number">.6</span><span class="hljs-number">.192</span>
</code></pre><p>Using the <code>+short</code> flag allows us to clearly see the path formed:</p>
<p><code>$ dig [www.skyscanner.net](http://www.skyscanner.net) +short</code></p>
<pre><code>www.skyscanner.net.edgekey.net.
e11316.a.akamaiedge.net.
<span class="hljs-number">23.217</span><span class="hljs-number">.6</span><span class="hljs-number">.192</span>
</code></pre><h3 id="heading-cname">CNAME</h3>
<p>A <code>CNAME</code> record allows a domain name to be used as an alias for another canonical (true) domain.</p>
<p>When the DNS server returns a <code>CNAME</code> record, it will not return that to the client. Rather it will again look up the returned domain name, and in turn return the <code>A</code> record’s IP address. This chain can continue many <code>CNAME</code> levels deep, but then suffers minor performance hits from multiple lookups before caching takes place.</p>
<p>A simple example of this could be if you have a server where you keep all your photos. You may normally access it through <code>photos.example.com</code>. However, you might also want it to allow access via <code>photographs.example.com</code>. One way to make this possible is to add a <code>CNAME</code> record that points <code>photographs</code> to <code>photos</code>. This means that when someone visits <code>photographs.example.com</code> they would be given the same content as <code>photos.example.com</code>.</p>
<p>Using the query <code>$ dig photographs.example.com</code> we would see:</p>
<pre><code>photographs.example.com    IN   CNAME photos.example.com
photos.example.com         IN   A     xx.xxx.x.xxx
</code></pre><p>It’s important to note that the <code>CNAME</code> is that piece to the right hand side. The left hand side is the alias name, or label.</p>
<p>Another common use is for the <code>www</code> subdomain. Having purchased <code>example.com</code> you likely also want users who type in <code>www.example.com</code> to see the same content.</p>
<p>It is worth noting here that <code>example.com</code> can be called the apex, root, or naked domain name.</p>
<p>One option would be to set up another <code>A</code> record, pointing to the same IP address as for <code>example.com</code>. This is completely valid, and is what the real <code>example.com</code> does, but it does not scale well. What happens if you need to update the IP address that <code>example.com</code> points to? You would also need to update it for the <code>www</code> subdomain, and any others you may use.</p>
<p>If a <code>CNAME</code> record was used to alias <code>www.example.com</code> to point to <code>example.com</code> then only the root domain would have to be updated, as all other nodes point to it.</p>
<h3 id="heading-cname-limitations">CNAME limitations</h3>
<p>At the time when the DNS standards were written, some rules were set out to govern their use. <a target="_blank" href="https://tools.ietf.org/html/rfc1912">RFC 1912</a> and <a target="_blank" href="https://tools.ietf.org/html/rfc2181">RFC 2181</a> set out that:</p>
<ul>
<li><code>SOA</code> and <code>NS</code> records are mandatory to be present at the root domain</li>
<li><code>CNAME</code> records can only exist as single records and can not be combined with any other resource record ( DNSSEC <code>SIG</code>, <code>NXT</code>, and <code>KEY RR</code> records excepted)</li>
</ul>
<p>This excludes a <code>CNAME</code> being used on the root domain, as the two rules would contradict each other.</p>
<p>What’s important here is that this is a contractual limitation, not a technical one. It is possible to use a <code>CNAME</code> at the root, but it can result in unexpected errors, as it is breaking the expected contract of behavior.</p>
<p>An example of this is <a target="_blank" href="https://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/">told by Cloudflare</a>, describing problems they encountered with Microsoft Exchange mail servers after having used a <code>CNAME</code> on their root domain:</p>
<blockquote>
<p>Domains generally designate the servers that handle their email through what’s known as a MX Record. The problem was that Exchange servers … could pick up the CNAME at the root record and then not properly respect the CNAME set at the MX record. You can’t really blame Exchange. <strong>They were operating under the assumptions laid out by the DNS specification.</strong></p>
</blockquote>
<p>Here you see the downside that can appear in several server softwares or libraries. Because a standard is in place for a <code>CNAME</code> to be the <strong>only</strong> record at a node, <strong>no other records are looked for.</strong> All other records will be silently ignored, without warning or error messages. Even if an <code>MX</code> record was set to receive email, the <code>MX</code> will be ignored as if it doesn’t exist because the <code>CNAME</code> is evaluated first. The same is true if there were an <code>A</code> record: the <code>CNAME</code> would take precedence and the <code>A</code> record would not be read.</p>
<h3 id="heading-the-modern-internet">The modern internet</h3>
<p>So why is this a problem? Why would you ever want to use a <code>CNAME</code> for your root domain anyway? Surely that is the end of the path when looking for the IP address of the web server hosting your content?</p>
<p>In the modern internet landscape, that is no longer the case. The world is very different from when the DNS standards were written.</p>
<p>You may choose to use a Platform as a Service (PaaS) provider like <a target="_blank" href="https://www.heroku.com/">Heroku</a> and store content on their web servers. You control the content, but not the infrastructure, and the PaaS provider does the heavy lifting of the network maintenance. They typically provide you with a URL (<code>my-app.herokuapp.com</code>) that is a subdomain of their root domain, and you can view the IP addresses for the web server(s) your content is on. But these are entirely under the PaaS provider’s control, and will change without warning.</p>
<p>The scale and frequency of backend changes made by the PaaS provider can make it hard to maintain your root domain <code>A</code> record pointing at a single IP address. Ideally you would wish to do this:</p>
<pre><code>example.com      IN   CNAME    my-app.herokuapp.com.www.example.com  IN   CNAME    my-app.herokuapp.com.example.com      IN   CNAME    my-app.herokuapp.com.
www.example.com  IN   CNAME    my-app.herokuapp.com.
</code></pre><p>to allow Heroku (or your chosen host provider) to manage updating the <code>A</code> record that the <code>CNAME</code> points to without any changes made on your side. However, as we now know, this breaks the DNS specification, so is a very bad idea.</p>
<p>It is possible to simply implement a <a target="_blank" href="https://www.namecheap.com/support/knowledgebase/article.aspx/9604/2237/types-of-domain-redirects--301-302-url-redirects-url-frame-and-cname">301/302</a> redirect from <code>example.com</code> to <code>www.example.com.</code> However, that instruction takes place either on the web server (so still having the problem of needing to use a fixed <code>A</code> record in DNS to point to that web server), or a custom DNS provider redirect (that <a target="_blank" href="https://support.dnsimple.com/articles/url-record/">suffers complications with HTTPS</a>).</p>
<p>This also has the side effect of changing the domain that you see in the URL bar, which you may not want. This method is intended for when your website has permanently moved, or when you’re trying to <a target="_blank" href="https://support.google.com/webmasters/answer/93633?hl=en">preserve SEO rankings</a>, rather than solving our problem of pointing to a complex changing backend in a scaleable way.</p>
<h3 id="heading-the-solution">The solution</h3>
<p>Several DNS providers have now developed custom solutions to work around this problem, including:</p>
<ul>
<li><code>ALIAS</code> at DNSimple</li>
<li><code>ANAME</code> at DNS Made Easy</li>
<li><code>ANAME</code> at easyDNS</li>
<li><code>CNAME</code> (virtual) at CloudFlare</li>
</ul>
<p>These are all virtual record types that provide <code>CNAME</code> like behaviour, with none of the downsides. The exact implementation can differ, but at a high level when the DNS server sees one of these virtual record types, it acts as a DNS resolver. It follows the chain created by the alias until it resolves at an <code>A</code> record (or records) and returns these <code>A</code> records to the DNS server. This ‘flattens’ the <code>CNAME</code> chain into the <code>A</code> record(s) returned, and is indistinguishable to the sent query. The query sees only a pure <code>A</code> record, which doesn’t break the DNS specification, and doesn’t have any of the disadvantages of a <code>CNAME</code>.</p>
<p>These virtual records can sit alongside other records at the root without any fear of unintended behaviours. Depending on the provider’s method of DNS resolution when following the <code>CNAME</code> chain, they may also have performance benefits from caching previous lookups.</p>
<p>For a DNSimple setup, we would then configure as below. This solution has all the advantages of domain name aliasing, and none of the risks of using it at root level.</p>
<pre><code>example.com      IN   ALIAS    my-app.herokuapp.com.www.example.com  IN   CNAME    my-app.herokuapp.com.
</code></pre><p>Thanks for reading! ?</p>
<p><em>As always, open to any corrections or additional points.</em></p>
<h3 id="heading-resources">Resources</h3>
<ul>
<li><a target="_blank" href="http://www.itpro.co.uk/domain-name-system-dns/30232/what-is-a-dns-server">What is a DNS Server</a></li>
<li><a target="_blank" href="https://www.wired.com/2010/02/Set_Up_a_DNS_Name_Server/">Set Up a DNS Name Server</a></li>
<li><a target="_blank" href="https://support.dnsimple.com/categories/dns/">DNSimple support pages</a> and <a target="_blank" href="https://blog.dnsimple.com/2014/01/why-alias-record/">ALIAS blog</a></li>
<li><a target="_blank" href="https://support.cloudflare.com/hc/en-us/articles/200169056-CNAME-Flattening-RFC-compliant-support-for-CNAME-at-the-root">Cloudflare support</a> and <a target="_blank" href="https://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/">CNAME blog</a></li>
<li><code>[dig](https://www.madboa.com/geek/dig/)</code> <a target="_blank" href="https://www.madboa.com/geek/dig/">HowTo</a></li>
<li><a target="_blank" href="https://stackoverflow.com/questions/656009/how-to-overcome-root-domain-cname-restrictions/22659895#22659895">Several</a> <a target="_blank" href="https://stackoverflow.com/questions/16022324/how-to-setup-dns-for-an-apex-domain-no-www-pointing-to-a-heroku-app">great</a> <a target="_blank" href="https://stackoverflow.com/questions/655235/is-root-domain-cname-to-other-domain-allowed-by-dns-rfc">Stack Overflow</a> or <a target="_blank" href="https://serverfault.com/questions/170194/why-cant-a-domains-root-be-a-cname?noredirect=1&amp;lq=1">StackExchange</a> <a target="_blank" href="https://serverfault.com/questions/613829/why-cant-a-cname-record-be-used-at-the-apex-aka-root-of-a-domain/613830#613830">posts</a></li>
<li><a target="_blank" href="https://en.wikipedia.org/wiki/CNAME_record">Well written</a> Wikipedia entries</li>
<li><a target="_blank" href="https://www.netlify.com/blog/2017/02/28/to-www-or-not-www/">Netlify blog</a> ‘To www or not www’</li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
