server – can DNS point to a specific port?

DNS has no concept of ports. DNS only points to the IP address.

The port to connect to for a particular service is determined by convention. For example, the default port for HTTP is 80 and the default port for SSH is 22.

The only way to override the default port is to specify it in the URL (or on the command line for something like SSH). There is no way to specify port numbers in the DNS. If you are using a website, your server must respond to HTTP requests on port 80 if you do not want the port number to be ugly in the URL.


I do not see exactly what you are trying to accomplish.

If you want to run multiple sites on the same server, this is usually possible. You can run multiple sites from different domains or subdomains on the same server. You must configure virtual hosts for this to work.

You may need to run a second server that uses a different technology (for example, Tomcat to run Java or a Rails server to run Ruby). In this case, it is common to connect your additional server to your primary server with the help of a reverse proxy to remove the port number from the URL.

If you try to host your site at home and your ISP blocks port 80, you're out of luck. Your only options are to find a different hosting or to have a port number in the URL.


There is a new innovation that allows port names to be specified by DNS: SRV records. However, they are only designed to work with new protocols designed to handle them. Older protocols such as HTTP and HTTPS will continue to use their current port numbers.