Running Your Own Recursive Nameserver on Ubuntu 10.04 (Lucid)

I got tired of my ISP’s annoying DNS servers that redirect me to search results I don’t want, complete with advertising, every time I mistype a domain name in the browser. So I changed my nameservers to google’s public DNS. I even set up a simple caching nameserver on my system in a bid to improve performance.

This met my needs, because Google doesn’t re-direct non-existent domains. The only problem is that I think google knows quite enough about me already. I don’t need to feed them a list of all the sites I interact with.

So, in part inspired by my recent adventures with name servers, as well as a suggestion by someone in #dns on about it not being rocket science to run your own recursive nameserver, I (yea) searched google, and ended up with an interesting set of instructions, which I didn’t need to follow to the letter.

They are here:

On my Ubuntu 10.04 system, all I needed to edit the configuration file, found at /etc/bind/named.conf.options . Remember to install the package ‘bind9’ first :).

I added the following lines, which were of course, dubbed from the ISC site linked a few paragraphs earlier.

controls { 
    inet allow { localhost; }
keys { "rndc-key";}

and in the "options {" block, I added the following:

allow-query { 
localhost; localnets; };
listen-on { any; };

Then I added a third block

view "default-recursive" { 
    match-clients { localhost; localnets; };
    match-destinations { localhost; localnets; };
    recursion yes;

Saved the configuration file, and then restarted bind ( sudo service bind9 restart )

Finally, I changed my network settings, putting in as the nameserver/DNS server.

Tested, and everything fine.

For a slightly finer explanation of the configuration files, at least the parts that matter, and to the best of my understanding, "localnets" means you’re also allowing other computers on the same LAN as yourself to set their system to use your new nameserver. of course, is the way that your system refers to itself. ‘localhost’ does a similar job, but of course, ‘localhost’ needs to be first resolved to an IP address :)

There, I now run my own recursive DNS server, and I feel pretty happy about it.

My entire config file (the one I edited) is here if you want it:

-my pic-
Random Quote:
Misfortune, n.: The kind of fortune that never misses. — Ambrose Bierce, "The Devil’s Dictionary"

Note to self, and fellow Googlers (about Mysql)

A default mysql install is not accessible across the network until you set its bind-address in the configuration file. The config file differs depending on your system.

So, if you’re getting Mysql Error 2003 (HY000) cannot connect to server… it is most likely that you haven’t set a bind address. After changing this setting, restart the mysql daemon/service.

Fanen Ahua -my pic-
Random Quote:
Journalism is literature in a hurry. — Matthew Arnold

Rage Dissipation and the Malfunction Magnet

A friend of mine carelessly dropped my HP M427 "point and shoot" digital camera today, effectively jamming the lens mechanism, rendering it useless. I believe it could be fixed, but I’m still enraged. I’ve been using this thing for almost a year now, and never dropped it once. I hand it to him for five minutes and I can no longer use my camera.

Well, in an attempt to distract myself from being consumed with rage, I decided to write up a few of the things I’ve been planning to blog recently. First off, I’m currently listening to "Love’s Divine" by Seal from "IV". Ok, that was hardly relevant. I did it ‘cos I can! Yeah!

Now, the malfunction magnet is merely an innuendo… or wait, I just like fancy titles, so just take it as one. So, In April 2008, I had to get a new laptop. My procedure for doing this kind of stuff is, I visit a manufacturer’s website, look in their business section, and grab any decent looking device that falls around the USD $1,000 range. This time, I chose HP (as usual, since they have two support centres in Nigeria), and the laptop in question was a HP 6710b.

I carefully read and re-read its specifications at to make sure it would play nice with Ubuntu, which I have been using for a number of years now. It was an all Intel machine (video and wireless), and was certified for Suse Linux Enterprise Desktop 10 so I felt confident. It also had bluetooth, so I wouldn’t have to be carrying any USB dongles about. I would have loved a screen bigger than 1280×800, but since I would be buying this in Nigeria, my options were quite limited, not to mention the costs. The other specs don’t matter, because any modern machine will do. I’m not a gamer.

I eventually picked this machine up from Ethel Ventures, Abuja. I was quite pleased to see Windows Vista Business on it, instead of that "Home" crap. I hate anything "Home" because of my previous experiences with Windows XP Home Edition (but this is just me, most regular computer users would hardly notice the difference). It also came with two shiny, factory-made Operating System DVDs and a driver restore DVD, which was excellent. Those annoying recovery DVDs don’t respect custom hard drive partition layouts.

I proceeded with installing Ubuntu, feeling confident that I could come back to play with Windows Vista anytime I felt like, since HP did ship the OS Installer (whose price was included in the laptop’s cost). I don’t know why, but I decided not to completely remove windows Vista. I left it with 25GB of my 120GB hard drive.

After bringing the machine to a usable state, I began to examine it. I noticed that there was no bluetooth support. Strange. This machine is supposed to have bluetooth. I checked in every way I knew I could, but found no bluetooth device. I even booted Windows Vista to check. Nil. Someone must have removed it along the line. I won’t blame Ethel, cos I think they are reputable, maybe it was a quality control oversight at a HP assembly line. Whatever, I can live without bluetooth.

A week or so into my use of this machine, I observed that I was experiencing random fatal system hangs that always resulted in a corrupted hard drive. For a while, I thought this was an Ubuntu problem, mostly because I had nothing else to blame it on. I re-installed the OS twice, even used a 64-bit edition for a while. Same random system hangs. I used Vista for a while, it worked fine. Weird. I endured. Ubuntu 8.04 was released a few weeks later, I upgraded, hoping for a cure. Still nothing. Just fatal, data corrupting system hangs.

I stumbled upon the root cause of this problem rather by accident one Friday morning. I was doing some washing, so I kept my shiny laptop on a flat wooden table, and cranked the music volume up to 100% so I could hear it from where I was doing the laundry. Five minutes later, the system dropped to a command prompt, spilling "ATA error messages" and generally being unable to execute any commands. I observed as always, that hard drive activity was at maximum during the crash. I began to wonder, is my hard drive defective? I still couldn’t blame Ubuntu. This kind of bug doesn’t exist in an OS undetected.

Then it struck me. Resonance. The laptop was sitting on a hard wooden table, with "all these things that I’ve done" by "the Killers" playing at the loudest volume. The table was being set into vibration, eventually resonating with the song, thus amplifying the vibrations that the laptop’s case was experiencing. The hard drive did not like this.

Well, I took the machine to a softer surface where the effects of resonance would be minimal, but the problem persisted. After a few cycles of ‘reboot-play music-crash’, I observed that 80% was the loudest the system could play music without irking the hard drive, and it didn’t depend on where the system was seated.

Apparently, I had bought a laptop in which one of the speaker cones was too darn close to the hard disk drive. Close enough to set the hard drive read head into resonance with its vibrations, causing read-write errors, which ultimately led to fatal system hangs, and subsequent data loss. Is this kind of thing covered under warranty? I don’t know, but perhaps I should let HP know somehow that they have a defective-by-design machine in the form of the 6710b.

I promptly called HP Abuja, and was quickly put through to an engineer. On hearing my complaint, he asked what OS I was running. I knew this was irrelevant, but I said Ubuntu. He said I should run the original OS that came with the machine and see if that still happened. Fair enough. I hung up, rebooted into Vista, played some loud rock, and promptly got a blue screen of death. This was exhilarating in one way, since this was the first time I was seeing this screen on a Windows Vista machine. I called them back, but they refused to acknowledge the cause of the problem. He murmured something about viruses, at which point I realised I was wasting my call credit.

I eventually got myself some external speakers, and I avoid playing anything at volumes higher than 80% when I’m using the internal speakers. Sure enough, I’ve not had such a crash ever since.


Fanen Ahua

Random quote: A plucked goose doesn’t lay golden eggs.