CompTIA Server+ (SK0-005)Server AdministrationMedium

A server administrator is deploying a new web server on a Linux distribution. The server needs to have a consistent IP address, gateway, and DNS server configuration that persists across reboots without using a DHCP server. Which file should the administrator modify to configure these static network settings?

  1. A/etc/network/interfaces
  2. B/etc/resolv.conf
  3. C/etc/hosts
  4. D/etc/sysconfig/network-scripts/ifcfg-eth0
Show answer & explanation

Correct answer: A. /etc/network/interfaces

On Debian-based Linux distributions (like Ubuntu), the '/etc/network/interfaces' file is used to define static network configurations for network interfaces, including IP address, netmask, gateway, and DNS servers.

Why the other options are wrong

  • B. This file is primarily for DNS resolver configuration, often overwritten by network managers or DHCP.
  • C. This file maps hostnames to IP addresses locally, not for configuring network interface settings.
  • D. This path is typically used on Red Hat-based systems (e.g., RHEL, CentOS), not Debian-based ones.

Linux Static Network Config

Manually assigning network parameters (IP, gateway, DNS) to a network interface on a Linux server.

  • Ensures consistent network identity.
  • Requires specific configuration files based on distribution.
  • Overrides DHCP settings if configured.

Memory trick: Interfaces define the network's face, resolv tells names where to race.

More Server Administration questions