liveBook · Manning

Domain name system

As explained in ASP.NET Core in Action, 3e

DNS is the hierarchical naming system that resolves hostnames to IP addresses and other network records.

The Domain Name System (DNS) maps a website hostname to an IP address. When someone enters a URL, the hostname helps locate the server that receives the browser’s HTTP request. section 1.4.1

A typical request uses DNS as part of this sequence:

  • The user navigates to a URL containing a hostname and path. section 1.4.1
  • DNS maps the hostname to the server’s IP address. section 1.4.1
  • The client connects to that IP address and sends an HTTP request. section 1.4.1

DNS also matters when an application calls another service with HttpClient. HttpClient performs a DNS lookup before establishing a connection. If the DNS record changes, a long-lived client may continue using the originally resolved server. section 33.1

Figure 1.2 Requesting a web page. The user starts by requesting a web page, which causes an HTTP request to be sent to the server. The server interprets the request, generates the necessary HTML, and sends it back in an HTTP response. Then the browser can display the web page.
CH01_F02_Lock3

Follow the request from browser navigation through HTTP communication and the server response. section 1.4.1

Figure 33.3 HttpClient does a DNS lookup before establishing a connection to determine the IP address associated with a hostname. If the DNS record for a hostname changes, a singleton HttpClient will not detect it and will continue sending requests to the original server it connected to.
CH33_F03_Lock3

Inspect how HttpClient resolves a hostname before connecting and why DNS changes can affect singleton clients. section 33.1

How ASP.NET Core in Action, 3e covers it

How deep it goes
Defines hostname-to-IP mapping and lookup timing, but stops short of DNS record types or resolver internals.
Examples
Uses microsoft.com, www.google.co.uk, facebook.com, and HttpClient connections as concrete hostname examples.
What it assumes
Assumes basic browser and HTTP request flow while defining hostname and IP address from zero.
What you can do after
Evaluate how hostname resolution precedes HTTP connections and why changing DNS can affect long-lived HttpClient instances.
How it connects
Connects hostnames, IP addresses, URLs, HTTP requests, and HttpClient.

Also explained in

Compare how 7 books explain domain name system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.