CompTIA Server+ (SK0-005)Server AdministrationMedium

A server administrator is configuring network settings for a new Debian-based Linux server. The server needs a static IP address, subnet mask, default gateway, and DNS server addresses. Which file should the administrator modify to configure these settings permanently?

  1. A/etc/network/interfaces
  2. B/etc/hostname
  3. C/etc/hosts
  4. D/etc/resolv.conf
Show answer & explanation

Correct answer: A. /etc/network/interfaces

On Debian-based systems, the `/etc/network/interfaces` file is the primary configuration file for defining network interfaces, including static IP addresses, subnet masks, gateways, and DNS servers, ensuring these settings persist across reboots.

Why the other options are wrong

  • B. `/etc/hostname` stores only the system's hostname, not network interface configurations.
  • C. `/etc/hosts` maps hostnames to IP addresses locally, but does not configure network interfaces or routing.
  • D. `/etc/resolv.conf` is primarily for DNS resolver configuration, but it's often dynamically managed and not the main place for static IP/gateway settings.

Debian Network Interface Config

The primary configuration file on Debian and its derivatives for defining network interface settings.

  • Located at `/etc/network/interfaces`.
  • Used for static IP, DHCP, gateway, and DNS settings.
  • Requires network service restart or reboot to apply changes.

Memory trick: Interfaces define how the network interacts.

More Server Administration questions