afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
[personal profile] afuna
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.

Date: 2010-04-05 03:58 am (UTC)
allen: (explosiverunes)
From: [personal profile] allen
I just turn of *expletive deleted* $USER_VHOSTS and $ONLY_USER_VHOSTS as soon as I get DW installed locally. Ugh.

Date: 2010-04-05 05:08 am (UTC)
exor674: Computer Science is my girlfriend (Default)
From: [personal profile] exor674
Also with those instructions, you've got to change your computers DNS server to 127.0.0.1

Date: 2010-04-05 07:32 am (UTC)
exor674: Computer Science is my girlfriend (Default)
From: [personal profile] exor674
You could always CNAME it on a local DNS server to the .local. domain ( or if you can be online to work, on your domain )

Date: 2010-04-05 07:34 am (UTC)
exor674: Computer Science is my girlfriend (Default)
From: [personal profile] exor674
You would have had to CNAME it to "example.local." not "example.local", as the former could imply example.local.domain.com

(note the . at the end, freaking dots)
Edited Date: 2010-04-05 07:34 am (UTC)

Date: 2010-04-09 10:14 am (UTC)
thorfinn: <user name="seedy_girl"> and <user name="thorfinn"> (Default)
From: [personal profile] thorfinn
Install BIND inside the Ubuntu VM, configure that with the wildcarded zone, and tell Ubuntu to use it's own local BIND as the resolver?

And yes, potentially you can configure the VM to run on a private network, and you can just give the VM a static IP address on that private network. I'm not sure how to do that using VMWare, since I use VirtualBox for the purpose, but the principle is the same regardless. Pick a different private network address range to whatever you're presumably already using for your home private network.

Date: 2010-04-09 10:19 am (UTC)
thorfinn: <user name="seedy_girl"> and <user name="thorfinn"> (Default)
From: [personal profile] thorfinn
It occurs to me - don't be thinking of the VM as something special and odd. Treat it as what it is - "virtual hardware". Part of that is creating a virtual network somehow, whether you're telling the VM to "bridge" the network device onto your existing local wires, or whether you're creating an entirely virtual private network, then using "NAT" to get from there to your local network (and from there back out to the Internet).

Once you've done that, then just set up Ubuntu on that virtual machine with everything you need - don't try and rely on installing and running development stuff on Snow Leopard. I <3 Mac OS X, but an open source friendly development environment, it is not.

Date: 2010-05-03 02:18 am (UTC)
thorfinn: <user name="seedy_girl"> and <user name="thorfinn"> (Default)
From: [personal profile] thorfinn
Ah, yes. System Preferences -> Network -> Advanced -> DNS

Check what the ubuntu VM's ip address is, and add that at the front of your DNS servers.

Note that that may cause issues if your VM isn't running, so you can add in the Google Public DNS servers after the VM one: 8.8.8.8 and 8.8.4.4.

You'll be bypassing whatever your ISP is telling you to use as a DNS resolver, essentially, and using the VM's BIND instead (and then using the Google Public DNS if that's not available).

You may have to change that Advanced DNS setting for each type of network you're connected via (Ethernet, Wifi, etc).

Date: 2010-05-03 02:19 am (UTC)
thorfinn: <user name="seedy_girl"> and <user name="thorfinn"> (Default)
From: [personal profile] thorfinn
Or alternately, test using a browser from inside the Ubuntu VM... Obviously that doesn't give you Safari, but Firefox etc should work. :-)