Results 1 to 9 of 9

Thread: SSH Could not resolve hostname

  1. #1
    Join Date
    Jun 2010
    Location
    Netherlands
    Beans
    69
    Distro
    Ubuntu 14.04 Trusty Tahr

    Exclamation SSH Could not resolve hostname

    Hi friends,

    Can maybe someone help with this question?

    I am trying to connect to a ubuntu server 12.04, with ubuntu 12.10, from the terminal and that is the response.

    Ssh 192.168.0.xxxxxxx
    ssh: Could not resolve hostname 192.168.0.xxxxxx: Name or service not known

    ssh username@192.168.0.xxxxxxxx
    ssh: Could not resolve hostname 192.168.0.xxxxxx: Name or service not known

    It have worked fine when both computers had ubuntu 12.04.

    I can connect it with putty and also with remmina, using the same correct address , but not on the terminal. What I am doing wrong?

    Any help will be high appreciated
    Thanks in advance

    João

  2. #2
    Join Date
    May 2006
    Location
    Milwaukee,WI
    Beans
    6,280
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: SSH Could not resolve hostname !!!

    did you change the real IP? it wouldn't matter if you showed it as those are internal private IP's and no one can do anything with them.

    you should be entering
    Code:
    ssh username@192.168.0.3
    or whatever the IP of the server is, it shouldn't have to resolve it's hostname as it's the IP.

  3. #3
    Join Date
    Apr 2012
    Beans
    7,256

    Re: SSH Could not resolve hostname !!!

    It's hard to see since you are replacing everything with x's (there really is no need to hide a private LAN IP like 192.168.xxx.xxx) but it looks like you have too many fields - are you trying to append a specific port? e.g.

    Code:
    $ ssh 192.168.1.102:22
    ssh: Could not resolve hostname 192.168.1.102:22: Name or service not known
    If so try using the -p option instead e.g.

    Code:
    $ ssh -p 22 steeldriver@192.168.1.102

  4. #4
    Join Date
    Jun 2010
    Location
    Netherlands
    Beans
    69
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: SSH Could not resolve hostname !!!

    Thank you friend.

    That have worked.

    $ ssh -p 22 steeldriver@192.168.1.102

    many thanks.

  5. #5
    Join Date
    May 2006
    Location
    Milwaukee,WI
    Beans
    6,280
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: SSH Could not resolve hostname !!!

    u don't need to specify the port if your ssh server is listening on the default port, which is 22.

  6. #6
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    1,524
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: SSH Could not resolve hostname !!!

    And changing the port is not a huge issue unless you intend on forwarding the ssh connection outside of your lan
    Catch me on Freenode - imark

  7. #7
    Join Date
    Jun 2010
    Location
    Netherlands
    Beans
    69
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: SSH Could not resolve hostname !!!

    Beautiful blog!! Very interesting.

  8. #8
    Join Date
    May 2006
    Location
    Milwaukee,WI
    Beans
    6,280
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: SSH Could not resolve hostname !!!

    Quote Originally Posted by Joao Lacerda View Post
    Beautiful blog!! Very interesting.
    thanks if you're talking about my blog.

  9. #9
    Join Date
    Aug 2013
    Beans
    1

    Re: SSH Could not resolve hostname

    I am now facing the same problem, and even worse, I can ssh the server in the lan, but I can't ssh my server form the internet, my iptables is set as xxx.xxx.xxx.130:20022 to 192.168.0.200:22, but when I do this" ssh server@xxx.xxx.xxx.130:20022, it results the same error, but when I ssh the gateway, I can ssh the server through the lan IP, but not the internet IP, thanks for your reply in advance. My e-mail: qishiyao2008@126.com

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •