i connect to a remote machine called 123.456.789.12 and would like to display as machine1 instead of the long IP. After reading hostname usage and testing for many times I still fail to do that despite I'm a root. is that due to DNS restriction or some other commands I should use? Thanks for your advice~
i connect to a remote machine called 123.456.789.12 and would like to
display as machine1 instead of the long IP. After reading hostname usage and
testing for many times I still fail to do that despite I'm a root. is that
due to DNS restriction or some other commands I should use? Thanks for your
advice~
It's unclear to me exactly what you want to do. Here are several suggestions:
- The name service itself is configured using /etc/nsswitch.conf. You _must_ tell the system which service you want to use -- local files (/etc/hosts), DNS, or otherwise.
- You can put static host name to IP address mappings in /etc/hosts. See hosts(4) for details.
- DNS is configured using /etc/resolv.conf. If you don't have the correct addresses in there, it won't work.
- Many networks use DHCP to configure local networking applications, such as name services. If you set up your system to run DHCP, and if you have a properly configured DHCP server, all of this will "just work."
-- James Carlson, Solaris Networking <james.d.carlson@sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
Thank you for helping me shape my question more precisely. In fact I am using SSH to connect a machine with fixed IP, say, 133.144.155.66, 133.144.155.67, 133.144.155.68, ...
when I'm opening more windows, I can only see 133.144 something. I would like to assign each machine a specific name so I can quickly identify which window I should use. Thanks again.