Re: hostname of remote computer
On Sun, Oct 31, 2010 at 2:57 PM, Seb <spluque@gmail.com> wrote:
>
> I use SSH to connect to a laptop computer that is in an institutional
> network. I would like to set an entry for it in my local /etc/hosts, so
> that I don't have to type the IP address every time I want to connect to
> is and simply use an alias. As per the man page, /etc/hosts has:
>
> IP_address canonical_hostname [aliases]
>
> To get the canonical_hostname I thought I'd easily get it by typing
> "dnshostname" when logged into the remote laptop, but that returns
> nothing, and "domainname" returns '(none)'. How should this
> canonical_hostname be specified in this case?
I've never seen "dnshostname" before. You must be looking for
"hostname" or "hostname -f". ("domainname" returns the nis domain.)
Reply to: