System Management

A Linux server must resolve db01.example.com to 192.168.10.15 locally, without any change to DNS. The name must also work as the short name db01. Which line should the administrator add to /etc/hosts?

Show the answer

Correct answerA. 192.168.10.15 db01.example.com db01

An /etc/hosts entry is the IP address first, then the canonical name, then any aliases, all separated by whitespace. Zone-file record syntax is tempting but belongs in DNS zone files and is not valid in /etc/hosts.