Compare the name in logs with the hostname currently held by the kernel.
Do not change configuration.
Which command is appropriate?
hostname with no argument displays the current hostname. Supplying a name can be a change operation and should be distinguished in diagnostics.
Detailed explanation
hostIncorrect. host queries names through DNS or the resolver.
hostnameCorrect. hostname without arguments prints the current hostname.
hostname app01Incorrect. hostname app01 requests a change.
ifconfig hostnameIncorrect. ifconfig does not use hostname as a host-name query.
Try it yourself
An example you can run in a temporary verification environment.
hostnameExpected result
現在のホスト名1行Key points
- No argument displays
- An argument may change it
- Hostnames and DNS names can differ
Notes
- Environment: Linux hostname / 読み取り専用
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Interface counters
Kernel-maintained counts of packets, errors, and drops at an interface.
Socket
A local or remote endpoint associated with a transport protocol and process.
Path tracing
A diagnostic method that observes hops and path limits toward a destination.