In this hands-on lab, you will be reviewing hostname information, name resolution, and network interfaces. Using the `hostnamectl` command, you will view and update hostname for the system. You will also add an entry to the `/etc/hosts` file and a DNS server to the default network connection, reloading the interface and cycling the service to pick up the change. Finally, you will drop a network connection and recreate it, assigning it an IPv4 address and gateway.
*This course is not approved or sponsored by Red Hat.*
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- View and Update Hostname Information
- Use
hostnamectl
to view hostname details. - Set a new hostname,
rh8server1
, for the system. - Set a pretty name,
RH8 Lab Server
, for the server. - Confirm new values were updated using
hostnamectl
.
- Use
- Update Name Resolution by Adding DNS Servers and Editing the /etc/hosts File
- Add a line to the
/etc/hosts
file, using the local IP Address and the valuerh8lab
. - Ping
rh8lab
to confirmhosts
entry works. - Use
nmcli
to view network connections. - Add the DNS server 8.8.8.8 to the default connection,
System eth0
. - Reload the interfaces and cycle the
NetworkManager
service to pickup the changes. - Confirm the
/etc/resolv.conf
contains the new DNS server.
- Add a line to the
- Drop and Recreate the Secondary Network Connection
- Use
nmcli
to view network connections. - Delete the secondary connection,
Wired connection 1
. - Recreate the connection with the following details:
- Name:
New connection
- Interface name:
eth1
- Type:
ethernet
- IP Address:
10.0.10.10/24
- Gateway:
10.0.10.1
- Name:
- Confirm the connection was created.
- Confirm the new interface has the correct IP Address.
- Use