While I’m developing the new UI for OurAirports.com on my laptop, I want to be able to test on various mobile devices easily, including other people’s devices (where it’s rude to root and mess around with
/etc/hosts). Here’s what I did:
- Assign my laptop a static IP address of 192.168.0.5 whenever it’s connected to my home WiFi (I’ve configured DHCP not to assign addresses under .11).
- Go to my DNS provider, and create an A record for
dev.ourairports.compointing to 192.168.0.5.
- In my laptop’s own
dev.ourairports.comto point to a 127.0.0.* IP address.
With these steps, the domain
dev.ourairports.com will always work from my laptop, wherever it’s connected, and it will work from other devices when I am on my home WiFi (anywhere else, it will probably bring up something strange, like a router or printer login page).
I’ve played around with Docker a fair bit, but I’m still happy just running a bunch of VHOSTs for different webdev projects, and so far, it hasn’t caused me any grief.
Does anyone have better suggestions? Any gotchas I’ve missed?