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@localhost ~]$ ssh a266 ssh: a266: Name or service not known --- [kai@localhost ~]$ ssh 192.168.0.101 kai@192.168.0.101's password: Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 [kai@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.
- edited the - /etc/sysconfig/network
- changed - HOSTNAME=a266
- restarted the network
Looks ok, hostname appears when logged on via IP, but can't use the HOSTNAME to log on from client.
[kai@localhost ~]$ ssh a266 ssh: a266: Name or service not known
[kai@localhost ~]$ ssh 192.168.0.101 kai@192.168.0.101's password: Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 [kai@a266 ~]$
I can't figure out where I missed out.
kai
In /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
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@centos.org [mailto:centos-bounces@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.
- edited the - /etc/sysconfig/network
- changed - HOSTNAME=a266
- restarted the network
Looks ok, hostname appears when logged on via IP, but can't use the HOSTNAME to log on from client.
[kai@localhost ~]$ ssh a266 ssh: a266: Name or service not known
[kai@localhost ~]$ ssh 192.168.0.101 kai@192.168.0.101's password: Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 [kai@a266 ~]$
I can't figure out where I missed out.
kai
In /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
it's a private 192.168.*.* address - it'll never be available from the wide internet directly, unless port forwarding or something is used on the NAT...
MaZe.
On Sat, 13 Aug 2005, David Campbell wrote:
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@centos.org [mailto:centos-bounces@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.
- edited the - /etc/sysconfig/network
- changed - HOSTNAME=a266
- restarted the network
Looks ok, hostname appears when logged on via IP, but can't use the HOSTNAME to log on from client.
[kai@localhost ~]$ ssh a266 ssh: a266: Name or service not known
[kai@localhost ~]$ ssh 192.168.0.101 kai@192.168.0.101's password: Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 [kai@a266 ~]$
I can't figure out where I missed out.
kai
In /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
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Correct this is a private network, works perfect Thank you Alexander.
The server receives the ip from a router and therefore I'd like to use a host name, since ip can change when rebooting router or server.
That would be the next issue since the 192.168.0.100/200 did not do it.
Do I have to enter all the ip addresses given from router to solve this or is there a one line solution?
kai
Maciej Żenczykowski wrote:
it's a private 192.168.*.* address - it'll never be available from the wide internet directly, unless port forwarding or something is used on the NAT...
MaZe.
On Sat, 13 Aug 2005, David Campbell wrote:
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@centos.org [mailto:centos-bounces@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.
- edited the - /etc/sysconfig/network
- changed - HOSTNAME=a266
- restarted the network
Looks ok, hostname appears when logged on via IP, but can't use the HOSTNAME to log on from client.
[kai@localhost ~]$ ssh a266 ssh: a266: Name or service not known
[kai@localhost ~]$ ssh 192.168.0.101 kai@192.168.0.101's password: Last login: Sat Aug 13 17:13:09 2005 from 192.168.0.102 [kai@a266 ~]$
I can't figure out where I missed out.
kai
In /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
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Sat, 2005-08-13 at 14:22, Kai wrote:
Correct this is a private network, works perfect Thank you Alexander.
The server receives the ip from a router and therefore I'd like to use a host name, since ip can change when rebooting router or server.
That would be the next issue since the 192.168.0.100/200 did not do it.
Do I have to enter all the ip addresses given from router to solve this or is there a one line solution?
Unless your router assigns the same IP address each time you should consider using static addressing. Some routers are able to assign reserved IP addresses to devices based on the MAC address of the network interface in the server.
Without that capability assign static IP addresses then the entries in your /etc/hosts file will always be correct.
For a small home network maintaining /etc/hosts files is not a problem.
Yes, thank you very much Scot. My router could assign static address to the server. I didn't check, believed that it could do one way or the other. Problem solved.:)
kai
Scot L. Harris wrote:
On Sat, 2005-08-13 at 14:22, Kai wrote:
Correct this is a private network, works perfect Thank you Alexander.
The server receives the ip from a router and therefore I'd like to use a host name, since ip can change when rebooting router or server.
That would be the next issue since the 192.168.0.100/200 did not do it.
Do I have to enter all the ip addresses given from router to solve this or is there a one line solution?
Unless your router assigns the same IP address each time you should consider using static addressing. Some routers are able to assign reserved IP addresses to devices based on the MAC address of the network interface in the server.
Without that capability assign static IP addresses then the entries in your /etc/hosts file will always be correct.
For a small home network maintaining /etc/hosts files is not a problem.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos