28

xip.io welcome screens says this :

10.0.0.1.xip.io resolves to 10.0.0.1

Why do we need to go through xip io when I can directly use the IP?

Is it used to access servers by domain name instead of IP?

gofr1
  • 15,741
  • 11
  • 42
  • 52
user6317694
  • 962
  • 1
  • 9
  • 19
  • https://stackoverflow.com/questions/26166205/cant-seem-to-access-xip-io-url-from-my-iphone-when-running-rails-app-with-pow#comment84801209_26166205 and https://stackoverflow.com/q/35991630/470749 are interesting questions about xip.io too. – Ryan Jun 22 '21 at 20:12

1 Answers1

43

The main use case is when your application needs to support multiple subdomains.

Take for example these production subdomains:

  • www.example.com
  • admin.example.com
  • members.example.com

Or you can consider a multi-tenant application where each account gets its own custom subdomain:

  • mycompany.example.com
  • anotherguy.example.com

So it's easy enough to setup a production environment to serve this requests.

But without a service like xip.io for your development environment, you cannot put a subdomain in front of an IP address to route your request appropriately.

To get around this, you can access your application through a subdomain like this through xip.io:

http://mycompany.10.0.0.1.xip.io/

As xip.io states, this then works flawlessly if you're trying to access the application from other machines on your local network, be they smartphones, tablets, other OSes within VMs, etc.

Chris Peters
  • 17,918
  • 6
  • 49
  • 65
  • 1
    Thanks Chris. This, in conjunction with name-based virtual hosting, makes perfect sense. – user6317694 May 23 '16 at 13:44
  • @user6317694 You're welcome. I suppose it makes sense for virtual hosting if you don't want the extra step of setting up a local DNS mapping to a local site. But I'm finding that the wildcard subdomain is the killer feature. – Chris Peters May 23 '16 at 17:07
  • (Especially when considering the need to test on smartphones, etc.) – Chris Peters May 23 '16 at 17:27
  • 1
    Clears out why WordPress Multisite AMI by Bitnami on AWS does this and not on the simple WP install. – rashid May 10 '20 at 02:10
  • If your website refers to its assets via domain name, you will not be able to resolve the urls for those assets and they will trigger 404 and display a broken website – Alexander Kucheryuk Mar 19 '21 at 08:12