A systems administrator is configuring a new application on a Linux server. The application needs to connect to a database server with the hostname db1.corp.local. When testing the connection, the administrator receives the following error: Could not resolve hostname db1.corp.local: Name or service not known. The administrator verifies that the application server has network connectivity by successfully pinging the IP address of its default gateway. Which of the following is the MOST likely cause of this error?
The server's routing table is missing a route to the database subnet.
The server's /etc/resolv.conf file is misconfigured.
A firewall rule is blocking traffic to the database server.
The correct answer is that the server has an incorrectly configured DNS resolver file. The error message Could not resolve hostname... Name or service not known specifically indicates a failure in the Domain Name System (DNS) resolution process. On Linux systems, the /etc/resolv.conf file is the primary configuration file for the DNS resolver, containing the IP addresses of the nameservers the system should query. If this file is empty, contains incorrect IP addresses for the DNS servers, or if the specified DNS servers are offline or unreachable, the server will be unable to translate hostnames into IP addresses, leading to this error. A firewall blocking the port would occur after name resolution and result in a connection timeout, not a hostname resolution error. An incorrect route would also manifest after name resolution, typically causing a 'Destination Host Unreachable' error. A disabled network adapter would prevent all network traffic, including the successful ping to the gateway mentioned in the scenario.