Access via IP address

I have a website [www.rdS.com] and if I ping it (or ask various online site) for its IP address it returns 66.96.149.32
So I THOUGHT, I could access the site using that IP address…
But strangely… if I type the IP address on the browser (Safari) address line… it creates a blank file in my download folder with the IP as the file name!

What the heck? my understanding, was the DNS translated the www.xxx.com into an IP address and used that, and by supplying the IP directly it just by passed the need to do a lookup?

You’re using a shared web host, which means the Host: header in the HTTP request must supply the domain name. The browser doesn’t know the domain name in this case so it uses the IP address for the Host header.

Since the server isn’t told which domain the request is for you get its default response. In this case the default is a 502 Bad Gateway status code and a chunk-encoded empty file (i.e. an ASCII 0 character followed by two end of line markers.)

well aint that a bummer… so much for the idea I had then :slight_smile:

Many hosts will allow you to pay extra for a dedicated IP address if you really need one.

Maybe, what are you trying to achieve? If you want to use a TCP socket it isn’t that hard to get a response/download a resource from your site.

You can always use the IP address to access the server and just hard code the domain in to the Host header, but this would all depend on what you’re trying to do and how you are trying to do it…

Great question. I would like to figure out how to view my security cameras. I can figure out the ip address, but what about the port? Do I need to know the port? Of course I can view them on my computer or phone via the manufacturer’s web site. But shouldn’t I be able to do it using Xojo? Dumb I know, but that goes with being a dumb programmer…

If you rifle through the HTML code, you should be able to find out some more information, otherwise try doing a web search for the make and model and see if anyone else has posted the info…