What Is /etc/resolv.conf

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 11, 2026

Quick Answer: /etc/resolv.conf is a configuration file on Unix and Linux systems that specifies which DNS nameservers are used to resolve domain names to IP addresses. Originally introduced in the Berkeley Software Distribution (BSD) in 1984, this file remains the standard method for DNS configuration on most Linux systems today, containing nameserver addresses and optional search domain directives.

Key Facts

Overview

/etc/resolv.conf is a configuration file found on Unix and Linux systems that controls how the system resolves domain names to IP addresses. This plain text file serves as the central repository for DNS (Domain Name System) resolver settings, specifying which nameservers the system should query when translating human-readable domain names like example.com into their corresponding IP addresses. The file is typically world-readable with permissions of 644, allowing all users to view DNS configuration while restricting modifications to root.

First introduced in 1984 as part of the Berkeley Software Distribution (BSD), /etc/resolv.conf has remained a fundamental component of Unix-like operating systems for over four decades. Despite modern alternatives like systemd-resolved and NetworkManager emerging in recent years, this file continues to be the standard method for DNS configuration on the vast majority of Linux systems worldwide. Understanding this file is essential knowledge for system administrators, DevOps engineers, and advanced users who need to manage network connectivity, troubleshoot DNS issues, or implement custom DNS security policies.

How It Works

The /etc/resolv.conf file operates by providing the system's resolver library with a prioritized list of DNS servers to contact when resolving domain names. When an application needs to determine the IP address associated with a domain name, the system consults this file to determine which servers to query. The resolver attempts each nameserver in order until it receives a successful response or exhausts the list, using UDP port 53 by default for DNS queries.

Key Comparisons

Aspect/etc/resolv.confsystemd-resolvedNetworkManager
Configuration MethodPlain text file, manually edited or auto-generatedSystemd service with D-Bus API and unit filesGUI tool, CLI, or configuration files
Year Introduced1984 (BSD)2014 (systemd 217)2004 (Red Hat)
DNS CachingNo built-in caching; delegated to NSCD or other servicesIntegrated local DNS caching with 4MB default cacheIntegrates with systemd-resolved for caching
Dynamic UpdatesOften overwritten by DHCP clients at bootHandles dynamic updates from DHCP, VPN, and interfaces automaticallyManages dynamic DNS updates through network profiles
ComplexitySimple and straightforward for basic setupMore complex but offers logging, caching, and DNSSEC supportModerate with graphical configuration options

Why It Matters

The /etc/resolv.conf file remains a cornerstone of DNS configuration in Linux and Unix systems despite being over four decades old. Its simplicity and universal availability make it an essential tool for network management, troubleshooting, and security optimization. Whether you're managing a single workstation or administering large server infrastructure, understanding /etc/resolv.conf is fundamental to effective system administration and network operations.

Sources

  1. Linux man-pages: resolv.confGPL-2.0
  2. Wikipedia: resolv.confCC-BY-SA-3.0
  3. systemd-resolved Interface DocumentationLGPL-2.1+

Missing an answer?

Suggest a question and we'll generate an answer for it.