• Post Reply Bookmark Topic Watch Topic
  • New Topic

SSH Connection via domain name?  RSS feed

 
Jiang Xiaofeng
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I currently have an Ubuntu system up and running. I can login via an SSH connection by doing username@ip_of_my_system. I also own a domain name and would like to be able to login via username@domainname. Obviously this is not a rare feat but thus far, I haven't been able to get it to work. Does anyone know some of the steps I need to take? Setting up forwarding through the company I registered with [I don't know if it's okay to mention the name] will forward HTTP requests fine and Apache serves up the pages but SSH logins are not forwarded in the same manner.

Thanks for any help.
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you need is a Domain Name Lookup system.

The Internet-wide "phone book" is DNS, on UDP port 53. If you enter a host domain name in a suitable utility (such as "nslookup" or "host") a sequence of network messages will pass through the DNS network until either the name is found and returned or it isn't found and you get a failure indication.

All that DNS does is pair a host domain name with its associated IP address, so all you're really doing when you ssh login with user id@ip address is bypassing DNS.

DNS isn't the only game in town. The /etc/resolv.conf file on a linux box specifies what resources are searchable and what order to search them in.

Usually, the hosts file (/etc/hosts) is at the top of the list. Among other things, it resolves the name "localhost" to IP 127.0.0.1, but you can, and often will have other names and IP addresses there as well.

The advantage for using /etc/hosts over DNS is that even if DNS is down, you can still resolve, and the resolution process is (usually) quicker. The disadvantage is that if someone changes their host's IP address, you have to manually update the /etc/hosts file.
 
Jiang Xiaofeng
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
All you need is a Domain Name Lookup system.

The Internet-wide "phone book" is DNS, on UDP port 53. If you enter a host domain name in a suitable utility (such as "nslookup" or "host") a sequence of network messages will pass through the DNS network until either the name is found and returned or it isn't found and you get a failure indication.

All that DNS does is pair a host domain name with its associated IP address, so all you're really doing when you ssh login with user id@ip address is bypassing DNS.

DNS isn't the only game in town. The /etc/resolv.conf file on a linux box specifies what resources are searchable and what order to search them in.

Usually, the hosts file (/etc/hosts) is at the top of the list. Among other things, it resolves the name "localhost" to IP 127.0.0.1, but you can, and often will have other names and IP addresses there as well.

The advantage for using /etc/hosts over DNS is that even if DNS is down, you can still resolve, and the resolution process is (usually) quicker. The disadvantage is that if someone changes their host's IP address, you have to manually update the /etc/hosts file.




Thanks Tim! I got it all straightened out and am now logging in without any trouble. I'm going to get POP3 set up and running this weekend. Any advice?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!