5
2
I've followed these instructions for setting up a local DNS server on my mac, and using it to server wildcard subdomains on localhost. It's a really nice thing:
http://mikeferrier.ca/2011/04/04/setting-up-wildcard-dns-on-localhost-domains-on-osx/
One weakness, though: I'm sometimes trying to work offline, and the local BIND instance is only consulted when you have a live connection with 127.0.0.1 in the DNS server list.
Is there a way to achieve this effect offline?
127.0.0.1 is offline. You can always connect to 127.0.0.1 = localhost. The only thing you need is the loopback interface aka localhost aka 127.0.0.1. I'm not an osx buff, and I don't have enough cred here to make a comment... What exactly is meant by "work offline"? A safari mode? – Ярослав Рахматуллин – 2011-06-16T12:43:15.437
I'm working on a site that uses subdomains-- using that trick above, I can fake that on localhost, so I have one.mydomain.local, and two.mydomain.local, etc, all resolving to 127.0.0.1. But it only works when I have an active connection. By offline, I just mean not connected to any network – Ross M Karchner – 2011-06-17T02:59:25.787
just make sure "lo", the loop-back is up. ifconfig lo up or whatever (where whatever is something like ifconfig 127.0.0.1 lo up; route add -net 127.0.0.0 gw 127.0.0.1 netmask 255.0.0.0 -- but you should not have to do this manually) – Ярослав Рахматуллин – 2011-06-17T03:11:04.853
Localhost is fine-- what I want is my locally running instance of BIND to be consulted for domain lookups, even when I'm not online. – Ross M Karchner – 2011-06-17T11:08:48.743
Related thread on StackOverflow here. – Barnabas Kendall – 2011-07-01T20:26:06.367