The precise location however depends heavily on your init system. To survive a reboot it has to be stored on file somewhere, which is linux distribution specific. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question. Asked 7 years ago. Active 4 years, 9 months ago. Viewed 26k times. Just in memory? Improve this question. Peter Krumins Peter Krumins 1 1 gold badge 2 2 silver badges 4 4 bronze badges.
If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? Related Posts. Any solution for this? Great help. Very clear. Thanks for the hostnamectl command Reply. I want to delete the hostname. Nice work, thanks Reply. Syntax : hostname -b Example: -d : This option is used to get the Domain if local domains are set. It will not return anything not even a blank line if no local domain is set.
Syntax : hostname -d Example :. Skip to content. Change Language. Related Articles. Table of Contents. The methods discussed in this tutorial will work in almost all Linux and Unix-Like systems.
If you are looking for detailed instructions on how systems such as Domain Names work, check out the resource on the link provided below:. The simplest method to get the hostname from an IP address is to use ping. Ping is a simple yet powerful command-line utility that uses ECHO packets to communicate with a host. For Linux, check the next method. The above command is not always reliable; it often only works if the hostname is available in the hosts file. The second and common method for getting the hostname from the IP address in Linux is the host command.
This simple tool is part of the dnsutil package.
0コメント