Hasty Briefsbeta

It's Not Always DNS: Exploring How Name Resolution Works

14 hours ago
  • #Name Resolution
  • #systemd-resolved
  • #DNS
  • DNS is not always the culprit in internet issues, as demonstrated by a recent incident unrelated to DNS.
  • Name resolution involves more than just DNS, including methods like /etc/hosts files and LDAP.
  • DNS translates human-readable domain names into IP addresses, essential for internet communication.
  • Different DNS record types serve various purposes: A and AAAA for IP addresses, MX for mail servers, CNAME for aliases, PTR for reverse lookups, and TXT for arbitrary text.
  • DNS operates hierarchically, with root servers at the top, followed by TLD (e.g., .com) servers, then domain-specific name servers.
  • Zones in DNS allow for distributed management, with primary and secondary servers handling authoritative records for specific domains.
  • The getaddrinfo() function in programming languages provides a powerful interface for name resolution, supporting multiple backends via the Name Service Switch (NSS).
  • systemd-resolved is a system service that handles DNS resolution, including caching and DNSSEC, improving efficiency and security.
  • Tools like resolvectl allow interaction with systemd-resolved, enabling cache inspection and management.
  • The resolution process involves multiple configuration files, including /etc/nsswitch.conf, /etc/resolv.conf, and /etc/hosts, as verified by strace.