can ssh by IP, can't by hostname.
I have a Fedora Core 3 box setup in my room on a wireless network.
In my routers page, the active leases says ... Code:
fragile 192.168.10.2 00:0C:76:96:8D:2B 18 hours, 5 minutes, 26 seconds Here's some config files on the acheron machine. Code:
[root@acheron ~]# cat /etc/hosts Code:
[root@acheron ~]# cat /etc/sysconfig/network Thanks in advance! |
Re: can ssh by IP, can't by hostname.
Quote:
Code:
>$ cat /etc/hosts |
this is a pretty simple problem.
None of your machines have actual/qualified host.domain.names when a machine tries to lookup a another by name it will ask one of the vast number of DNS(domain name server) machines on the internet. But you presumably do not own linux.net so that will not work. There is a simple way to work around this. You should first change the domainname of the machines with the linux.net at the end by editing the file /etc/domainname or maybe /etc/dnsdomainname to be blank. Then you can use the file /etc/hosts to tell each machine the name of each other on your network. This file will get checked first when you try to get to a machine by name. just add entries to /etc/hosts like this on seperate lines darkstar 192.168.10.4 fragile 192.168.10.2 do this on each of your machines. that should do it. |
try setting up a dns server on a spare box if u have one (or install the service on an existing one). it's pretty simple in windows and i dont think its incredibly hard in linux, that way u wont have to worry about name resolution being screwed up because u mistyped something. if ur gonna stay w/ host files, make sure u check /etc/nsswitch.conf to make sure that file is listed to first to save u a few miliseconds in name resolving.
|
Well, so far, without doing any of this, I have my laptop working fine. I had to startup the samba service (which I had taken down while in school). Now my laptop can ping all of the other computers fine. The hosts file is the same, so I'm curious why it's able to suddenly. I don't have any dns services/servers up as far as I know, either.
I went through the services list on both the laptop and desktop and all services are the same. I also went through /etc/hosts and /etc/sysconfig/network and they both have identical setup. I also changed the domain to launchmodem.com since that is what my ISP assigned. Hoped that would do something to. So now, why can the laptop ping all other machines on the network, while the desktop cannot?:confused: edit: when it goes through my DNS to lookup acheron.launchmodem.com, it goes to my router first, which is then supposed to notice that it's a local machine, correct? So I see no reason why I would need to setup a DNS server on this machine. last edit: fixed. added .. Code:
hosts: files dns wins Thanks for the help :) |
Quote:
|
Hi all!
I'm having the same issue as the topic starter. I can connect to my machine via ssh using the ip, but not using the hostname. I'm a linux noob, so beware. ;-) When the pc starts it sets the correct hostname, so that should be fine. My /etc/hosts file looks like this: 127.0.0.1 localhost computers static ip computer.univ.ac.be When I try to ssh using the hostname, ii times out..... Am I missing something else here? Oh yeah, same thing happens when trying to sftp.... ip works, hostname doesn't. Using Mandriva 10.2. Thanks! |
It's probably a good idea to start your own thread on this. My problem finally fixed itself, I suppose. I never had to do anything for this to be solved. I'm still confused by it. I think it eventually had to do with a mixture of samba problems and router setup. Start a new thread and I'll be sure to look it up, though.
Good luck. |
All times are GMT -5. The time now is 10:44 AM. |