hostname(1) General Commands Manual hostname(1)NAME
hostname - Sets or displays the name of the current host system
hostname [-s] [new_name]
The hostname command sets or displays the name of the current host system. If you use the -s option, the short form of the host name is
displayed. Only the superuser can set the hostname.
To display the short form of the local host name, enter: $ hostname -s host1 To change the name of the local host, enter: # hostname west
Defines the Interface Program name and address of the local host.
Functions: gethostname(2), sethostname(2)hostname(1)
Check Out this Related Man Page
hostid(1) General Commands Manual hostid(1)NAME
hostid - Sets or displays the identifier of the local host
/usr/sbin/hostid [hostname | hexadecimal_number | internet_address]
The hostid command displays the 32-bit identifier of the host as a hexadecimal number in host standard byte order. The identifier must be
unique across all hosts and is commonly set to the Internet address of the specified host. The superuser can set the host ID by specifying
a hostname, internet_address, or hexadecimal_number argument. The identifier is stored in network standard byte order.
To display the identifier of the local host, enter: $ hostid
The hostid command displays the identifier of the host as a hexadecimal number in host standard byte order. To set the identifier
of the local host to the local Internet address, enter: $ hostid 5184.108.40.2065
The hostid command converts the Internet address to its hexadecimal equivalent, and then sets the local host to this address.
Note that the sample Internet address in this example, 5220.127.116.115, is not a valid Internet address and would cause hostid to
return an error.
Functions: gethostid(2), sethostid(2)hostid(1)
I am wondering if by logging in to a unix system, if it is possible to get the IP address of the machine I am connecting FROM.
I know how I can do this using the name server, but is this possible without a host lookup?:confused:
-ghoti (15 Replies)
in many of the linux machines i have tried this but the result is the same everywhere.
if there are double letters in a hostname then that is displayed as single letter.
e.g. if hostname is set to nepttune then login into the shell will display :
$ hostname... (15 Replies)
We have a code to find the DNS entry of a host that has a trailing '-' in its url (format example: mysite-.watch.com):
But when remove the '-' from the host name the code does not return... (12 Replies)
I am running Solaris 2.6 Server on a Sparc 10 and I was wondering how I can manually specify a DNS server to resolve hostnames. Any help will be greatly appreciated.
And also I have created a file in the /etc dir named defaultrouter and added th IP address of my router, but when I ping another... (15 Replies)
I'm working on a rather large script atm (it already takes 9 arguments). As such, I need to obtain both a server name and domain from the FQDN. From this, I want to both populate the hostname of the server, as well as the domain line in the /etc/resolv.conf file.
Obviously, this isn't working. I... (10 Replies)
I've got a puzzler here but it might be quick solution for some of you.
I'm trying to add a second IP address to a network adapter on a Solaris 10 box. I've created a hostname.bge0:1 file and put in the new name, e.g. new.mycom.com. I've added the new IP and the name to hosts. I've... (12 Replies)
I am writing a script and need to get the hostname of the remote server in order to zip that file... the syntax in which the file is named is "hostname.html."
This is the line I am trying to use
ssh $host "/bin/gzip /tmp/`hostname`.html" >> $PATH_TMP/Linux_cfg2html.log
but whenever I run it... (26 Replies)
iam having file with below lines of text
how to extract the host name and store in a variable and to print output using awk command
output will be
Tnx in advance. (13 Replies)
Please i have to get hostname of an ip address (172.16.68.4). so i have used the command 'host'
host $ipaddr >> iptohostname.txt
Here is my file: iptohostname.txt
18.104.22.168.in-addr.arpa domain name pointer g-4.xxx.yyyy.zz.
22.214.171.124.in-addr.arpa domain name pointer... (11 Replies)
I have vmware on my windows PC ( hostname : acer ).
vmware has RHEL 7 ( hostname : rhel7 ) installed recently.
RHEL IP configuration
IP : 192.168.5.128
Netmask : 255.255.255.0
ssh to rhel7 works from acer using putty
host... (12 Replies)
Dear all experts,
I would like to know where can I find the hostname located as when I receive the syslog, I can only see as below : (showing in localhost instead of the hostname)
Feb 6 15:31:31 localhost syslog:info syslogd: restart
Feb 6 15:31:50 localhost syslog:info syslogd: restart
Feb... (13 Replies)