System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to force system to use full "hostname.domainname" instead of the alia "hostname"

 
SOLVED
Go to solution
Advisor

How to force system to use full "hostname.domainname" instead of the alia "hostname"

I want to force HP-UX use "hostname.domainname" instead of just a short alia "hostname". For example, a server's host name is grey, domain name is surg.sm.com. When I am using telnet/ssh connecting to this server, I want to use "telnet grey.surg.sm.com" instead of "telnet grey".

I've already cleaned related item in /etc/hosts, but the alia is still workable. What else do I need to do?

Thanks in advance.
4 REPLIES 4
Honored Contributor
Solution

Re: How to force system to use full "hostname.domainname" instead of the alia "hostname"

> I want to force HP-UX use [...]

Do you mean that you want to force the HP-UX
_users_ to specify fully qualified names?

cat /etc/resolv.conf

You can try throwing out the "domain"
directive, but that may not be enough.

Why would you want to do this? Are things
too convenient now?
Advisor

Re: How to force system to use full "hostname.domainname" instead of the alia "hostname"

Thanks for your info. I now achieved my purpose. Btw, we can also remove the "dns" item in /etc/nsswitch.conf. I did this just for study purpose. I will recover the configuration and make it confortable for all other users.

Thanks.
Honored Contributor

Re: How to force system to use full "hostname.domainname" instead of the alia "hostname"

>.. I now achieved my purpose..
Hi chenn, Do you want to share with us how you did it?
Advisor

Re: How to force system to use full "hostname.domainname" instead of the alia "hostname"

assume target machine name is grey, domain name is surg.sm.com.

1. remove "grey.surg.sm.com" related item in /etc/hosts
2. remove "domain surg.sm.com" in /etc/resolv.conf if it has

ping target machine with hostname only will return fail in this condition.

#ping grey -n 1
#ping: unknown host grey
#
#
#ping grey.surg.sm.com <-- works OK
#

3. restore /etc/hosts
4. restore /etc/resolv.conf

This time, ping with hostname only:

#ping grey -n 1 <-- works OK