quiz image

Linux hostnamectl Command

GuiltlessAshcanSchool avatar
GuiltlessAshcanSchool
·
·
Download

Start Quiz

Study Flashcards

5 Questions

What does tracepath send subsequent packets with?

The smallest MTU on the entire link

What is the difference between tracepath and tracepath6?

tracepath is for IPv4 and tracepath6 is for IPv6

What is the advantage of using tracepath over traceroute?

It can determine the smallest MTU on the entire link

What is the purpose of the nc program?

To send or receive arbitrary data over a TCP or UDP network connection

What is the potential issue with using tracepath and other troubleshooting tools?

Equipment may block the packets

Study Notes

Hostname Configuration

  • The hostnamectl command can be used to set the hostname of a system.
  • The --transient option sets the transient hostname, which is not stored in any file.
  • The --static option sets the static hostname, which is stored in the /etc/hostname file.

Displaying System Information

  • The hostnamectl command can also be used to display various descriptive and identity bits of information about the running system, including:
    • Static hostname
    • Pretty hostname
    • Transient hostname
    • Icon name
    • Chassis
    • Machine ID
    • Boot ID
    • Operating System
    • Kernel
    • Architecture

Name Resolution

  • There are two basic ways to match names and IP numbers: using a local source or a remote server.
  • The hosts database keeps track of the mapping between host names and host numbers.
  • The /etc/hosts file can be modified to associate multiple names with a single IP address.
  • The /etc/nsswitch.conf file defines the priority order of the sources for name-IP matches.

Networking Fundamentals

  • Linux expects TCP/IP settings to be in specific places and may need to be changed when the default settings are not appropriate.
  • The ip link show and nmcli device commands can be used to list the network adapters present in the system.
  • The /etc/network/interfaces file is used by the ifup command to activate interfaces during boot time.
  • The /etc/nsswitch.conf file is used by the system and applications to determine the sources for name-service information in a range of categories, called databases.

Persistent Network Configuration

  • Files in /etc/systemd/network can be used to override the configurations in /lib/systemd/network.
  • Files with a .netdev suffix are used by systemd-networkd to create virtual network devices, such as bridge or tun devices.
  • Files with a .link suffix set low-level configurations for the corresponding network interface.
  • Files with a .network suffix can be used to set up network addresses and routes.

Network Troubleshooting

  • The ip command can be used to manually configure network interfaces, including viewing and changing the configuration of network interfaces.
  • The ip command can also be used to manually configure routing, including viewing and changing routing tables and setting the default route.
  • The tracepath command can be used to troubleshoot network connections and detect the smallest MTU on the entire link.
  • The nc command can be used to send or receive arbitrary data over a TCP or UDP network connection.

Learn about the hostnamectl command in Linux, its options and usage to set and display hostname information.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Linux Knowledge Quiz
5 questions

Linux Knowledge Quiz

ImaginativeLavender avatar
ImaginativeLavender
Linux Operating System Concepts
18 questions
Hostname Configuration
5 questions

Hostname Configuration

GuiltlessAshcanSchool avatar
GuiltlessAshcanSchool
Use Quizgecko on...
Browser
Browser