I have a CentOS VPS running Tomcat on port 80 and HTTP on port 81. I didn't know how to configure DNS. I searched and figured out there are websites that give you DNS. So I got DNS address from cloudflare.com and set it up on my domain. Now I can access my websites running on tomcat.
Everything works fine but I can't access other ports by typing domain names like:
example.com:81
But I can do it by typing:
192.0.2.1:81
So I want to know is there any way to access other ports by domain names or simply that is not possible and if not why?
192.0.2.1
and you got the domain nameexample.com
hosted on a DNS service and pointing to your VPS, that would meanexample.com
resolves to192.0.2.1
. If that was the casehttp://example.com
would probably produce the same result ashttp://192.0.2.1
. That's why I am guessing the service you found is not DNS but rather a proxy. And likelyexample.com
resolves to a proxy such as198.51.100.1
which only listens on port 80 and forwards the requests to192.0.2.1
.