-1

Let us discuss so we can come up with a working solution.

Suppose we have an arbitrary address 1.1.1.1 that is a broad domain. Now we know that it hosts a domain named "website.site". But we want to access it via browser prompt field using 1.1.1.1 as any of dig/ping/nslookup returns. How would we do it?

We want to avoid modifying any files in our system.

3
  • can't be done reliably with all the constraints you put on this - and this is not a discussion site Commented Jun 13 at 6:02
  • @JaromandaX I see, okay. So, it can be done with programming (only). Regarding "not a discussion", should I delete this post?
    – Futman
    Commented Jun 13 at 18:56
  • @Futman - If you are looking to have a discussion on that topic, then you probably, should delete the question. However, asking a question then deleting it, most definitely isn’t contributing positively to the community
    – Ramhound
    Commented Jun 14 at 1:50

2 Answers 2

0

You can't without "modifying any files in our system."

Its worth considering a few scenarios though. If its the only website hosted on the server you could just use the IP address. You'd want the server appropriately set up.

Lets assume - for example that you're running a 'simple' web server like the built in python one, on port 80. As far as the web server's concerned a request is a request, whether its to the IP, or any domain name pointed at it.

Practically speaking, you would use things like virtual hostnames and reverse proxies. The critical thing here is you need to tell the server what web page you want served - in theory, if you connected to a server via IP, and, as per the wikipedia article, you had a HOST http header that pointed at website.site, it'd connect there. I've not personally done that, but this stack overflow answer indicates its possible with some extensions.

Practically its a lot more convoluted than running a 'local' DNS server or modifying a hosts file, and both of these are much better solutions than trying to 'avoid' DNS usage for accessing resources for any reason.

-1

If you want to access a host via an IPv4 address, simply enter the IPv4 address into a web browser's address bar. This works as expected in Firefox.

If you know the protocol you want to use, you can preface the IPv4 address with the protocol. To use your example: https://1.1.1.1

A good test IP address to use is: https://146.112.59.2

This is Cisco's Cloud Security status page, and is always available at that IPv4 address, even when your network's DNS is down.

This, of course, only works when a single host is served from an IPv4 address. In the case of virtual hosts, you have to specify more than an IPv4 address to access the specific virtual host you desire.

3
  • 1
    That'd break down with vhosts tho
    – Journeyman Geek
    Commented Jun 13 at 5:13
  • @JourneymanGeek indeed. That is my point. I thought it is clear in my question. Maybe I should clarify
    – Futman
    Commented Jun 13 at 5:31
  • @JourneymanGeek Yes, of course. I thought that was obvious too. I'll clarify. Commented Jun 14 at 0:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .