Ægir on Ubuntu Server - DNS question

Events happening in the community are now at Drupal community events on www.drupal.org.
merro's picture

Hello,

I've installed Ægir into Ubuntu server ( latest version, Jaunty? running in VMware on OSX), using the install script. Ægir installed and configured fine and i can create sites, but i'm having trouble viewing the sites because of ( what i'm guessing is) my DNS settings.

I can login to Ægir fine, its running on ubuntu.local

For a test i setup a site: nio.local

Ægir set it up, but when i click on "Visit site" it can't find the site, I know its something to do with the DNS and i installed
WEBMIN http://www.webmin.com/ and tried to add nio.local to the dns settings but so far i'm having no luck.

I wanted to install it on a virtual server first so i could learn my way around before rolling it out on our dedicated hosting. Any help with setting up the DNS correctly would be much appreciated.

Thanks

Comments

Setting up DNS can be a big

mig5's picture

Setting up DNS can be a big job if you're not familiar with DNS in general.

You essentially need to set up a 'zone' within which, you can either create an 'A' or 'CNAME' record for nio.local to point to your server.

But you have to do that for each site you create. Instead, it is faster to create a wildcard DNS entry *.local that points to localhost, and then anything.local will resolve, and you never have to deal with it again.

If you know you are only going to be setting up nio.local and, say, three other sites, in your local environment, you can hardcode these entries into /etc/hosts, which effectively is checked first before a DNS lookup is attempted.

So in /etc/hosts you could put

( ip address of ubuntu.local ) nio.local
( ip address of ubuntu.local ) merro.local
( ip address of ubuntu.local ) mig5isawesome.local

(minus the brackets)

And they should all then resolve.

Have a read about Wildcard DNS on wikipedia.

Unless you're familiar with DNS syntax and concepts, including how to make your system query the local nameserver instead of your ISP's in the /etc/resolv.conf and stuff like that, I'd recommend you take the slightly more time-consuming-but-easier approach of adding entries into /etc/hosts like above.

Good luck!

Thanks for the quick reply!

merro's picture

Adding to /etc/hosts worked like a charm. I should have thought of that, but i was intent on trying getting the DNS to work... which really shouldn't be a priority on this test server.

When i set it up on our dedicated hosting (netregistry) will it ( setting up the DNS ) be as simple as: Setup the domain in the netregistry console, point it to our nameservers and then add a new client with that domain in Ægir?

Thanks again for the quick and detailed response, I'm sure i'll have more questions as i start playing : )

When i set it up on our

mig5's picture

When i set it up on our dedicated hosting (netregistry) will it ( setting up the DNS ) be as simple as: Setup the domain in the netregistry console, point it to our nameservers and then add a new client with that domain in Ægir?

Well, that's not really 'setting up the DNS', that's creating a domain and delegating authoritative nameservers for the domain, in the registrar.

The key part here, is 'our nameservers' - these are the ones that need to have a zone resolving the domain to an IP, and to do so authoritatively.

And it's here that if you need a wildcard domain, you define it in the zone file.

If you have a site in aegir with domain 'example.com', and you've set up authoritative nameservers to answer requests for example.com with '111.222.333.444' IP, and your webserver has this IP, then the site will be served by Apache, thanks to the vhost configuration file that Aegir generates for the site.

Hope this answers your question.

editing hosts files a slight pain?

mibstar's picture

I'm slightly confused as to whether I need to edit the hosts files on the virtual server too...

I've setup aegir on debian and have had some issue creating sites from specific platforms (open atrium & open publish) and was wondering if it was related. I'm running VMware Fusion on my mac and have been editing the /etc/hosts for every new subdomain... but do I need to on my virtual server too? Does aegir require it?

Or even better, is there an easier approach?

On this line I followed the guide on http://geoffhankerson.com/node/108 and setup the wildcard on my Mac but I've not been able to configure the virtual server to look it up... if it's possible.

Any pointers would be appreciated.

Thanks

For other boxes on your LAN...

troubador's picture

For other boxes on your LAN, you want to add a similar entry in each /etc/hosts, except the IP is the LAN iP for your Aegir box. You can find the IP with /sbin/ifconfig. It will probably be something like 192.168.1.100. If so, the other boxes in your LAN need to know that nio.local goes to 192.168.1.100, right? So on the /etc/hosts on the LAN boxes, you add:

192.168.1.100 nio.local

On Windows XP, there is also an /etc/hosts file at
C:\WINDOWS\system32\drivers\etc\hosts

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: