afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
Just tried to set up a wildcard DNS on Snow Leopard according to these instructions:

http://geoffhankerson.com/node/108

But I couldn't get it to work, and I think even if it did, it doesn't do what I need it to anyway.

Basically, I'm running Ubuntu in a VM in Snow Leopard, so I can have a local 'hack environment. It works, but I need to add an entry in my hosts file for each new test user I create (inconvenient, but a minor annoyance). The bigger problem is that every time I put my laptop to sleep, the internal IP changes when it wakes up, so I need to edit the hosts file again (sometimes I forget to, and I end up staring at a blank screen, wondering if I've borked my dev env :-()

Anyway, no big loss with not being able to set up wildcard DNS. From what I understand now, setting up my own DNS server would have fixed the first problem (which I only need to deal with occasionally) but not the second (which I have to deal with every time I start up my server).

I don't want to just set up the wildcard DNS under my website (afunamatata.com) because I wanted it to work when I'm not connected to the internet, and it still doesn't solve the second problem with the shifting IP address, so I'd need to open up the browser, log on, and edit the IP address online (then wait for the DNS cache to flush?) before any work session. UGH.

I can always access my VM under its .local address, but I can't find a way to redirect all *.dream.fu traffic to .local. All the solutions I've thought of so far seem worse than the original problem! So I guess it's put up and just deal with editing my hosts file all the time.

If I can't think of a better way, I wonder if I could just set up a script which looks up the current IP address of my hosts file, and then use sed or awk to replace the IP address in my hosts file (parse the output of traceroute? dig, nslookup, host don't work).

Soooo right now I don't think I know enough to do what I want, or to even know if it's possible to do what I want, but I think I know enough by now to confirm that the above won't do what I need it to, so okay.

ETA:
Ah an now the obvious answer for #2 hits me: set Ubuntu to use a static IP, so that the IP address stays constant, even after going to sleep/waking up (Not so obvious bits: finding out what the IP address of the router is, since it's something VMWare set, not something I did, but I found it using the route command on Ubuntu).

I don't know if I did it right. I thought I'd set this to a static IP before, but I guess I did something wrong (I don't remember doing it this way, either *g*). Hopefully I've got it figured out this time.