View Single Post
  #6   (View Single Post)  
Old 21st May 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I think I understand where your confusion comes from. Domain names are part of URLs, which is sent from the browser to the webserver. But URLs are not part of an SSH connection. And there are plenty of other Internet applications that do not use URL/URIs.

Here's how DNS works, in general, for Internet applications. If URLs are used, they're passed in the first data packet after a TCP connection is established. That doesn't happen for ssh:
  1. The ssh client program (any of them .... OpenSSH's ssh(1), putty, or a commerical ssh client) is provided a domain name by the user.
  2. The client program makes a resolution request of the client's OS. When the OS is *BSD, the resolver is generally configured by /etc/resolv.conf. See the gethostbyname(3) man page for details.
  3. If the resolution requires DNS, the resolver makes a DNS request to the primary DNS server. This is a relatively quick UDP "conversation" between the client's OS and the DNS server. The client OS submits the query with the supplied domain name, and the DNS server replies with the IP address.
  4. The client application makes a TCP connection to the resolved IP address, using the port supplied by the user or the client application (port 22 is the default "listening" port for sshd servers).
So your sshd server never sees the domain name.
Reply With Quote