I run CentOS 4.1 on a remote server and did a minimal installation. My problem is that I can not login using the HOSTNAME, must use the IP. 1. edited the - /etc/sysconfig/network 2. changed - HOSTNAME=a266 3. restarted the network Looks ok, hostname appears when logged on via IP, but can't use the HOSTNAME to log on from client. --- [kai at localhost ~]$ ssh a266 ssh: a266: Name or service not known --- [kai at localhost ~]$ ssh 192.168.0.101 kai at 192.168.0.101's password: Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 [kai at a266 ~]$ --- I can't figure out where I missed out. kai
Am Sa, den 13.08.2005 schrieb Kai um 19:22:> I run CentOS 4.1 on a remote server and did a minimal installation. My > problem is that I can not login using the HOSTNAME, must use the IP. > > 1. edited the - /etc/sysconfig/network > 2. changed - HOSTNAME=a266 > 3. restarted the network > > Looks ok, hostname appears when logged on via IP, but can't use the > HOSTNAME to log on from client. > --- > [kai at localhost ~]$ ssh a266 > ssh: a266: Name or service not known > --- > [kai at localhost ~]$ ssh 192.168.0.101 > kai at 192.168.0.101's password: > Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 > [kai at a266 ~]$ > --- > I can't figure out where I missed out. > > kaiIn /etc/hosts on host 192.168.0.102 add a line 192.168.0.101 a266.<whatever your domain part is> a266 This said when not running an own DNS. If a name server for the own domain is running, then be sure /etc/resolv.conf has the "search" entry for the domain, to be able to reach the other host by short hostname. Alexander -- Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773 legal statement: http://www.uni-x.org/legal.html Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.11-1.35_FC2smp Serendipity 19:26:33 up 5 days, 5:15, load average: 0.14, 0.29, 0.33 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Dies ist ein digital signierter Nachrichtenteil URL: <http://lists.centos.org/pipermail/centos/attachments/20050813/721e183e/attachment-0002.sig>
and it will still not be available using the hostname from the internet without using a dns server and/or a service like dyndns.org or tzo.com ... the cost is about $30 or $40 per year per host name. -----Original Message----- From: centos-bounces at centos.org [mailto:centos-bounces at centos.org]On Behalf Of Alexander Dalloz Sent: Saturday, August 13, 2005 1:29 PM To: CentOS mailing list Subject: Re: [CentOS] SSH hostname login Am Sa, den 13.08.2005 schrieb Kai um 19:22:> I run CentOS 4.1 on a remote server and did a minimal installation. My > problem is that I can not login using the HOSTNAME, must use the IP. > > 1. edited the - /etc/sysconfig/network > 2. changed - HOSTNAME=a266 > 3. restarted the network > > Looks ok, hostname appears when logged on via IP, but can't use the > HOSTNAME to log on from client. > --- > [kai at localhost ~]$ ssh a266 > ssh: a266: Name or service not known > --- > [kai at localhost ~]$ ssh 192.168.0.101 > kai at 192.168.0.101's password: > Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 > [kai at a266 ~]$ > --- > I can't figure out where I missed out. > > kaiIn /etc/hosts on host 192.168.0.102 add a line 192.168.0.101 a266.<whatever your domain part is> a266 This said when not running an own DNS. If a name server for the own domain is running, then be sure /etc/resolv.conf has the "search" entry for the domain, to be able to reach the other host by short hostname. Alexander -- Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773 legal statement: http://www.uni-x.org/legal.html Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.11-1.35_FC2smp Serendipity 19:26:33 up 5 days, 5:15, load average: 0.14, 0.29, 0.33