• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Hostname problem external ip not working

Ruhat

VIP User
Joined
May 4, 2009
Messages
404
Reaction score
16
Location
Swedie
Hi Otland,

I have a problem that is hard to fix.
My external ip isn't working anymore, i can't even connect via PuTTY or WINSCP.
I'm running on debian linux wheezy 7.1.

I edited the /etc/hosts and /etc/hostname

/etc/hosts file:
Code:
  GNU nano 2.2.6              File: /etc/hosts                                  

127.0.0.1       localhost
127.0.1.1       server

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

On the /etc/hostname

Code:
server

I want the /etc/hosts to be like the first time i installed linux. (not modified)
If someone has debian linux with /etc/hosts that works please send it so i can compare.
Thanks!

Regards
Ruhat
 
Last edited:
This is how it should look like.

Code:
127.0.0.1 localhost
127.0.1.1 ServerHostname

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
 
This is how it should look like.

Code:
127.0.0.1 localhost
127.0.1.1 ServerHostname

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

thanks and what should /etc/hostname contain?
 
I don't either :p

And you connect to your server with SSH using 192.16x.x.xx?
And the PC you use also has 192.16x.x.something?

And ssh is definitely running on your server?


I connect to SSH via my hostname, but when i try to connect via my external ip that i get from whatismyip.com, it doesn't work.
So SSH works fine, also i can have access to my website with the external ip.
But i found my external ip on hosts.deny <- for some reason i've blocked myself out? so i deleted my ip from hosts.deny.

I'll try now and see if it works.

EDIT: Can't still connect with the external ip through SSH, i can only connect via hostname.
 
Last edited:
So SSH is up, running and reachable.

My guess is that the problem is somewhere around the router.
Why do you want to make SSH available for the whole world in the first place?

If you cannot configure your router to route port 22 to your server, you can try two different approaches:
  • Use a different port on your router. E.g. use port 2222 and redirect it in the router to your server on port 22.
  • Change ports on both sides. E.g. make sshd running on port 2222 and add forwarding to the router from port 2222 to your server.

It might also have another cause that you cannot connect to your own server on your external IP. Your router may not be a able to route traffic from within your network to your own external IP correctly. In this case you cannot use your external IP to connect anywhere in your local network.
You can test that by trying to connect from outside of your network (i.e. the internet) to your external IP and check if that works.
 
So SSH is up, running and reachable.

My guess is that the problem is somewhere around the router.
Why do you want to make SSH available for the whole world in the first place?

If you cannot configure your router to route port 22 to your server, you can try two different approaches:
  • Use a different port on your router. E.g. use port 2222 and redirect it in the router to your server on port 22.
  • Change ports on both sides. E.g. make sshd running on port 2222 and add forwarding to the router from port 2222 to your server.

It might also have another cause that you cannot connect to your own server on your external IP. Your router may not be a able to route traffic from within your network to your own external IP correctly. In this case you cannot use your external IP to connect anywhere in your local network.
You can test that by trying to connect from outside of your network (i.e. the internet) to your external IP and check if that works.

Man thank you very much.
You said that i couldn't connect to my own server using the external ip, you were right.
I tried using hotspotshield and it connected perfectly with the external ip.

Thanks again man!!!

EDIT: btw I had both csf and denyhosts installed on the server, but uninstalled denyhosts.

SOLVED :)
 
Back
Top