LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Cannot SSH/FTP by hostname, but ip works (https://www.linuxquestions.org/questions/linux-networking-3/cannot-ssh-ftp-by-hostname-but-ip-works-365144/)

joshtt 09-20-2005 03:36 AM

Cannot SSH/FTP by hostname, but ip works Solved!
 
Hi all!

I know a thread like this already exists and I posted there too, but no one is looking at that one anymore, so here goes....
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 (which includes that security center with different security levels).

Thanks!

spooon 09-20-2005 03:52 AM

I don't think you need to put a line in your /etc/hosts file; your DNS should be able to look it up. What does it say if you do "nslookup <hostname>" and "nslookup <computers-static-ip>"?

joshtt 09-20-2005 04:23 AM

Hi spooon,

thanks for helping me out.
I did nslookup with the ip and the hostname.
Strange, looking up with the ip returns a hostname different that the one that should be assigned to me.
And looking up with the hostname returns an ip that's not mine.

Am I correct to conclude that I'm using the wrong hostname?

Josh

joshtt 09-20-2005 05:08 AM

Ok, I just reconfigured my network settings to use the other hostname and it works!!!!
Seems like those guys at the networking center here at the univ. gave me the wrong hostname.

Thanks for helping me out, spooon!!!! ;)


All times are GMT -5. The time now is 11:29 PM.