Setting Up A Caching DNS Server on OSX Server

I’ve been running the same Linux server for about 10 years. Consequently, its pretty slow and outdated, and when I finally had time to upgrade it to Ubuntu from SuSE 9 while I was on vacation, found that I couldn’t really get anything but Ubuntu 8.04 installed on it. So it was time for an upgrade.

I opted to go with a Mac Mini server – for a few reasons. The price was basically comparable to an Intel server with the same technical specifications (minus any kind of CDROM drive, which I found out later) – but the big selling point for me was the amount of space I could save in the office with the Mini. A side benefit was, of course, being able to play with Snow Leopard Server.

After the initial set server setup – which was painless – my first task was to create a caching DNS server so that all of the machines in the house could point to the same place they were when the Linux server is shut down. One of the primary purposes of the Linux server over the years, aside from being a file server, has been to cache and manage local DNS for the machines in the house. I already had plans to run an Ubuntu Server in a VM on this box to replace my aging Linux box (I still need Linux around), but didn’t think it was acceptable to have to boot the machine, THEN a VM in order to have DNS working. I also did not want to do a DNS setup on a box by box basis on every machine in the house.

I was a little confused at first. I’m used to configuring bind directly. After some googling around and not finding much of anything around doing this on OSX Server, I posted a tweet asking if any of my followers knew of a HOWTO that would explain what I needed to do.

I actually tweeted a little too soon. I think I found the settings about 2 minutes after the tweet went out. It was way easier than I thought it would be and I thought I’d throw up a quick step-by-step tutorial so that folks wanting to do the same thing could save themselves a couple of seconds.

So here we go.

In the dock, find the “Server Admin” icon and click it. It looks like this:

OSX Server System Admin

OSX Server System Admin

When the “Server Admin” Tool opens, you will see the main screen like the following. The blue arrow is pointing to the domain you specified while setting up the server.

OSX Server Admin Tool Main Screen

OSX Server Admin Tool Main Screen

Open up the domain for your network, and you will see a bunch of services to configure. Select DNS as shown in the following screen shot:

OSX Server Admin Services Menu

OSX Server Admin Services Menu

Once you select DNS in the side navigation, select “Settings” at the top. This will show you the following screen:

Server Admin DNS Settings Screen

Server Admin DNS Settings Screen

You’ll see a box conveniently titled “Forwarders”. Add the IP addresses of the DNS servers you would like to forward requests to in this box by clicking the ‘+’ key and adding each independent IP. As you can see here, I am primarily using Open DNS with Google DNS as a backup. Trust me, contrary to the picture, OpenDNS is first.

Once you have entered your DNS IP addresses, click “Save”. Point your boxes to the IP for your Mac Mini server and voila! You have a caching DNS server.

I hope this was helpful. For those of us who are used to configuring bind with vi, it may be a little confusing or intimidating to try to mimic this functionality on OSX Server. As you can see, its really a no-brainer – and no text editors need be opened.

Things for iPhone (Time Management)

I’ve finally decided to bite the bullet and buy Things, an application on the iPhone for task management (Getting Things Done style). I’ve only started using it this morning, but I can already see the benefit of getting things out of my head and into my inbox for categorization. I’ll write more on whether I actually stick with it and find it effective later on.

All I can say is, I hope so. I’m not doing too well these days on remembering the volume of things I need to accomplish – and paper and notebooks just don’t do it for me.

Miscellaneous Updates for February 2008

I’m doing an extremely bad job of keeping the site fresh over the last few months or so. I figured I’d give a quick update of things going on.

I’m Still Not Smoking

I finally started the Step 3 of the Nicoderm CQ program. This one has been rough. This is where you really start physically feeling the consequences of nicotine being removed from your system. I’ve been completely exhausted for the last week. Apparently, that there nicotine is one powerful stimulant and really screws with your metabolism. Your body takes some time to equalize itself and get itself back to where it needs to be naturally. I’m hoping mine gets there soon – because I’ve not had a good time over the past week.

The interesting thing about these “stop smoking aids” is that they defer you dealing with the real issue until you have so much skin in the game that you can’t start again without feeling an intense feeling of failure. Brilliant, but I can tell you that first step gives you an overly simplified view of what it takes to quit smoking. It starts getting a little harsher at step 2 and now at step 3 you really start PHYSICALLY feeling it. The only thing worse will be when Step 3 is over and my body starts eliminating nicotine all together.

Like I said though, I have too much skin in the game now to restart – I think.

New iPhone User

Address Book on iPhoneJonna bought me an iPhone for our anniversary, and I have to say that aside from the GPS she got me for Christmas, which allows me to go out by myself and still be able to get home, it is about the coolest thing for me from a productivity perspective that we have added to my highly disorganized life.

I’m finally able to get all my contact information in one place where it is accessible at any time. I can take notes, I can look things up on the web and I can check personal email. From a browsing perspective, I can get to things that are a part of my life but are blocked at the firewall at work (which is great as well). I feel free.

Now, it hasn’t been without its problems. The 1.1.3 software that came with the phone dropped a lot of calls. It wound up pretty frustrating and I kept my work supplied cell phone so that I could actually hold calls without them getting dumped. The 1.1.4 update took care of this though and now it works like a real phone.

I love the contact management included in the phone. Support for multiple numbers per contact and custom labelled information (including notes) lets me keep track of all the information I could ever want about someone. I can even attach a picture. Integration with the Mac Address book allows me to keep my contacts up to date without having to type into the phone.

And speaking of typing into the phone – I love not having to type on a standard phone keypad. The automatic spell-checking sometimes gives me a run for my money, and more often than not makes me sound retarded, like this little exchange with Jonna:

Trouble With Abbreviations

<Insert large sigh from Jonna because I don’t listen or read>

Overall though, I think between the GPS for Christmas and the iPhone this month, I’ve received the two most useful (and really most used) gifts ever.

As an aside, for those who are obsessed with not scratching or smudging their iPhone or other Apple products, Jonna also picked up a skin called Best Skins Ever for both Kelsi and myself, which we applied a couple of weeks ago. Kind of scary at first (you need to use water to apply it), but they really are the best skins ever. You don’t even know they’re there. I’m definitely going to pick up one for my iPod, as soon as I get a round tuit.

Well thats it from the Labs for last month. I’m sure as the weather starts to warm and the nicotine continues to seep out of my system, I’ll have more energy to blog about useful things.

How To Set Up Mac OSX To Print to a Windows Print Share

I found one annoyance about Mac OSX. I could not figure out how to set my Mac up to print to our shared printer that is connected to a Windows XP machine.

Well, thats not necessarily true. I figured it out once, but for some reason it just stopped working using the standard printer setup. Since then, I’ve been printing to PDF, emailing the document to myself, and grabbing it on the machine with the printer and printing the PDF. Since we were setting up Jonna’s new Vista machine anyway and working through those connectivity issues, I decided to work on getting printing to work for real.

After culling through a bajillion posts today, I finally figured out how to do it. I figured this ‘pictorial’ could give you all of the steps you need to do without having to go through the effort that I did to get the information.

As an aside, all images were grabbed and marked up using Skitch.

smb-printer-setup-step1

smb-printer-setup-step2

smb-printer-setup-step3

Apple made it very non-intuitive to get to the advanced options. You have to hold down the Option key, then click “More Printers” in order to get to it. This annoyed me. The advanced option should be there no matter what. I shouldn’t have to do anything special to add the smb: address of the printer.

smb-printer-setup-step4

smb-printer-setup-step5

smb-printer-setup-step6

‘username:password’ is the username and password to log into the Windows machine with. IP Address is the IP of the Windows machine with the printer, and finally share name is the name you gave to the printer when you shared it.

smb-printer-setup-step7

I hope this “graphical representation” of the process helps you get your shared printers up and running. This is what I needed. Rather, I had to read through many false starts and theories before getting to the meat of the issue, which was essentially getting to the ‘Advanced’ options in the print manager. Now you know the secret. Happy printing!

iPod Power Adapter – Sold Separately

Photo by rbieber

Kudos to Apple for getting an even larger share of my wallet. When you buy an 80G iPod, the only way you can charge it is through your PC. In order to charge via AC power (say when your getting ready to travel and will not be taking your home machine with you), you have to spend another $40 on a USB Power adapter. These use to come WITH the unit.

Subversion, MediaWiki, WordPress, and LDAP

One of the biggest arguments you’ll get in deploying open source software in a corporate environment perception that they are extra, standalone applications. If your corporation uses an LDAP server, you can get some big wins by ensuring that your open source applications can authenticate with your corporate LDAP store, showing integration with the main systems.

I recently went through this exercise with a number of applications in our environment, including:

  • Subversion
  • MediaWiki
  • WordPress

I thought I’d throw up an entry here outlining the tools I used to make this integration possible.

Subversion was a no-brainer, since we host our repositories using mod_dav_svn. Configuring the mod_auth_ldap module in the Apache server and converting all access to SSL made this integration painless, once I figured out how to build Apache to use OpenLDAP and Secure LDAP. For MediaWiki, the Mediawiki LDAP Extension worked flawlessly. The key problem with Mediawiki is that there is no mechanism built in to ensure that logins are performed via SSL. A quick rewrite rule in the Apache server took care of this for me. A complete explanation of this process can be found at Library Web Chic.

For WordPress, I found a great plugin from Kane IT Consulting that was extremely easy to configure. I had the plugin installed and configured in minutes. I highly recommend this one. The Admin-SSL plugin, gave us the security around the login that we needed.

What has been interesting to me is seeing the subtle shift in perception of these applications as we integrated them into the authentication system. They almost seem like legitimate pieces of the system now … even to me.

Subversion and SSL Troubles

I decided to upgrade my home Subversion repository to version 1.4.3 as soon as it was released. Since then, my ViewVC application has ceased to work, getting a Python exception every time I try to execute it. Creating a small Python program that just imports the library (from svn import fs) gave me the following error:

ImportError: /usr/local/lib/libsvn_ra_dav-1.so.0: undefined symbol: SSL_load_error_strings

Thinking it was an SSL library problem, I upgraded SSL – a few times. I kept mucking with the options, rebuilding Subversion, only to get everything installed and get that same error:

ImportError: /usr/local/lib/libsvn_ra_dav-1.so.0: undefined symbol: SSL_load_error_strings

Over, and over and over again I repeated the process and got the same result. The absolute definition of insanity. This has been going on for a couple of months and I’ve been trying to address it in my spare time, as I’ve been pretty busy lately during the week and gone to the Relaxation Unit the last few weekends.

I googled my ass off to find the error, but to no avail. Finally today I ran across this thread that explained the problem. After going through my distribution directory for 1.4.4 (which I upgraded at the beginning of the month only to receive the same error) I realized that I hadn’t pulled down the Subversion dependencies tarball and rebuilt neon. So, basically I was using an old version of the neon libraries.

I finally settled on the configure statement listed here, after downloading and untarring the deps file:

./configure --with-ssl --with-apxs=/usr/local/apache2/bin/apxs 
            --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 
            --enable-shared --with-libs=/usr/local/ssl

This uses the already installed apr libraries that I build with my Apache server, and ensures that the neon shared libraries are built. A quick configure/make/make install/make swig-py/make install-swig-py sequence later and my Python libraries were working fine.

I made it a point this time to document this on the Labs internal wiki, but thought I should throw this out here in public so that others can find it. Hope it helps save the weeks of frustration that I have been suffering for someone out there.

Happy building …