0

How can I configure my EC2 instance so that one specific wildcard domain (e.g. 1.2.3.4.xip.io) resolves to some IP that I've chosen (e.g. 5.6.7.8), and all other DNS resolution proceeds as usual?

Adding the following line to my /etc/hosts file didn't help:

5.6.7.8 1.2.3.4.xip.io
Amit Kumar Gupta
  • 17,184
  • 7
  • 46
  • 64

1 Answers1

0

All systems have a hosts file in which you can override specific DNS lookips. On linux based systems it should be /etc/hosts. In windows its somewhere in the windows folder.

The format is very simple, but you want to be careful about deleting anything already in it. Each line is set up as 123.123.123.123 mydomain.com

datasage
  • 19,153
  • 2
  • 48
  • 54
  • Thanks, but that didn't quite work. I've updated my question with an additional detail. – Amit Kumar Gupta Sep 29 '13 at 03:07
  • This will set the dns resolution for your requests originating from your instance. Are you trying to do something else? – datasage Sep 29 '13 at 03:09
  • I have a "workstation" EC2 instance, a "warden" EC2 instance, and a "router" warden-container inside the "warden" instance (a VM inside another VM). Let's say the have IPs w.o.r.k, w.a.r.d, and r.o.u.t respectively. From inside the "warden" VM, I can make requests to the router like so: .r.o.u.t.xip.io. However the r.o.u.t is not reachable from the rest of the world, in particular I can't reach it from the workstation. I'd like to be able to make the same request from the workstation VM to the router. – Amit Kumar Gupta Sep 29 '13 at 03:20
  • My current approach is kinda complicated, I'm open to better suggestions. If I can get r.o.u.t.xip.io to resolve to w.a.r.d on my workstation, and then have nginx running on the warden VM to proxy requests (from .r.o.u.t.xip.io/ to .r.o.u.t.xip.io/) then I think this will work. – Amit Kumar Gupta Sep 29 '13 at 03:23