Zoneedit.com Dynamic DNS update script

June 13th, 2008

We use both DynDNS and ZoneEdit for our Dynamic DNS. We use inadyn for our Dynamic DNS Custom Zones, but since inadyn uses DynDNS’s checkip service, it doesn’t seem fair to use it for our ZoneEdit zones too.

zoneeditscript is freshly written as of 12th June 2008, so maybe there will still be a few bugs! Installation is simple – just copy the 2 files to wherever you want them on your system (we have them in /etc). Configuration is fairly straightforward – see the notes in the files zoneeditscript and zoneedit.hosts:

The shell script zoneeditscript

The script checks a router’s WAN IP address by SNMP or by using whatismyip.org. It defaults to whatismyip.org, changing it is a matter of moving the comment symbol. Use SNMP if your router supports it, then your IP-change check only uses LAN traffic, but be warned – neither of the cheapo routers I tested it on could cope with repeated SNMP traffic! There’s plenty of output from the script, both to stdout (we redirect it to a file, for stats) and to the system log for actual IP changes and error conditions.

If you are hosting many domains on a Dynamic IP address, you can list them all in zoneedit.hosts:

zoneedit.hosts, the domain list for zoneeditscript

Other features… not many. After updating the zoneedit.com zones, it goes to sleep for an extra long time. This is an effort to reduce the effect of any error in the script that causes repeated queries to zoneedit.com. If you’re in the bizarre situation of needing to make repeated updates of your WAN IP address (maybe you’ve got intermittent connection / testing your router’s power switch?), you can killall -s SIGHUP zoneeditscript and the update should run immediately. If you’re adding sites to the zoneedit.hosts file (did I say it could cope with lots of domains, not just one?) you can also force an update this way.

What else do you need to know? No licence, none needed. If you’re home hosting, I hope it saves you some time. Maybe our paths will cross one day and you can buy me a coffee. I like Bakewell tarts.

Happy hosting!

Edit: My el-cheapo Caremo router has become unresponsive, possibly as a result of all the SNMP queries. I’ve emailed telogy.com (now TI?) to ask why. It was still routing effectively, but not responding to SNMP, telnet, ssh! And further edit: I plugged in an unreliable D-Link G604T the Caremo replaced (I have terrible taste in routers), and got no further than 90 queries before it too stopped responding. They both come back after a ‘rest’, so perhaps the ‘query as fast as you like’ needs to take into account how awful your router is under load.

Digg, StumbleUpon, Slashdot buttons for WordPress

June 13th, 2008

Sociable is one of those plugins that makes WordPress such a joy to use. Super easy to install, just download, copy and unpack the archive. Setup from the WordPress Admin panel. This is what really floats my boat about some of the WordPress contributions – they’re beautiful! The author could have used a list of checkboxes to select the social networking sites you want buttons for, but they did this instead:

Sociable Settings

Lovely! So easy to setup, just select the best and most appropriate social networking sites for your blog. Or if you’re like me and don’t get out much, just the ones you’ve heard of before, and enjoy the result at the foot of every article:

Sociable buttons

There are also buttons in Sociable for printing and emailing an article. I’m delighted with this plugin! I downloaded the 2.6.6 version, and it had a teensy-weensy little fly in the ointment: the tooltip for Digg says ‘bodytext‘ when you hover your mousepointer over the Digg button. Never mind! This is open source and we know how to roll our sleeves up! Find the file sociable.php in the wp-content/plugins/sociable directory. Open it with a text editor and find the line that contains ‘bodytext’. Delete the whole line. Save the file. Better than new – now the tooltip says ‘Digg’! Here’s a superfluous image for the fix:

Cutting the \'bodytext\' line from sociable.php

Select, cut, save. I think you’ve got the idea now. Happy blogging!

Streamyx SMTP server authentication problem

June 10th, 2008

TM logo

The SMTP AUTH settings in this post have been updated in a later article.

It has been a busy few days. I’d noticed a couple of funny messages in the maillog generated by our sendmail daemon, but put them to the back of my mind. Here’s an example:

Jun 10 00:29:16 box0043 sm-mta[9729]: m59GTFu0009727: to=<someone@somewhere.com>, ctladdr=<someone@domain.com> (1000/100), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120489, relay=smtp.streamyx.com. [202.188.0.212], dsn=5.7.1, stat=Service unavailable
Jun 10 00:29:16 box0043 sm-mta[9729]: m59GTFu0009727: m59GTGu0009729: DSN: Service unavailable

In retrospect, the log entries don’t seem so benign. In actual fact, the emails were not delivered. DSN is a Delivery Service Notification, which can be used to notify a sender by email when there’s a problem. It seems I had two problems on my mail server setup, as I didn’t get any email notifications of the failures. Most of the outgoing emails were sent by a PHP program running on our webserver, so may have been sent to the webserver’s non-interactive user.

The cause of this problem might have been harder to find, if it were not for a dim recollection of seeing a message somewhere that TM were planning to block mail from users who had never changed their default Streamyx password. I’m one of those people, and when I saw the recent message thought once again “Oh, I must get round to doing that”.

Well it seems they must have put their plan into action. To test my suspicion, I tried to log in to my mail account at http://webmail.tm.net.my – no joy. You can change a Streamyx password at the TM Billing site. Once I’d done that, webmail login worked just fine, I reset my ADSL router after changing the Streamyx password, and updated my sendmail auth file.

To make sure sendmail is logging in to the Streamyx SMTP proxy, you must edit your auth/client-info file and make sure the AuthInfo line is up to date:

AuthInfo:smtp.streamyx.com "U:USERNAME@streamyx.com" "I:USERNAME@streamyx.com" "P:PASSWORD"

Then execute the following commands to compile your sendmail settings:

makemap hash client-info < client-info


/etc/rc.d/rc.sendmail restart

That’s it! I may have imagined the threat from TM regarding default passwords and the SMTP proxy, but I don’t think I did. If you can track down that message, I’d love to see it again – it bothers me that it has disappeared.

Update: thanks to mylinear at WebmasterMalaysia.com, who pointed out that it’s the message on the TM Helpline (1300-88-9515)! Here she is:

Google AdSense on WordPress

June 9th, 2008

I’m enjoying using WordPress – some things have just been designed very well. I searched for advice on getting AdSense advertisements on my blog, and ended up installing a couple of different AdSense plugins that were … okay, but seemed a bit overkill for what I want. It’s actually very easy to show Google ads, and there’s no need to install anything.


AdSense ads are Google’s context-sensitive ads that you see all over the Internet. It costs you nothing to put them on your page, and you can earn money from people clicking on them. The money comes from subscribers to Google’s AdWords advertising service, where advertisers can place adverts that are cued by keywords in your pages.

The simplest way to get started with Google AdSense on WordPress is to add a Text Widget to your sidebar. Go into the admin pages for your blog, and choose Widgets from the Design page. Just click on the ‘Add’ link next to the Text Widget in the list of available Widgets. You can change the order of the widgets in the sidebar by dragging them. Click on the Edit link of the Text Widget in the list of your sidebar’s Current Widgets. You’ll see a text box open up, and this is where you can put anything you want, including the code that pulls in the Google AdSense adverts.

Getting the code that displays the Google AdSense adverts is very easy. It’s actually a very simple piece of code, mostly a placeholder, but with an important identifier that is used to select who gets paid when a visitor to your blog clicks on an ad.

Don’t be misled by offers to put AdSense on your blog for you! Unless you go through the AdSense account setup process yourself, and get your own AdSense code, you could be missing out on revenue generated by your blog articles.

You can sign up for the Google AdSense program at http://www.google.com/adsense and just click on the big friendly, shiny ‘Sign up now’ button. Google just needs to know who you are and how you want your money.

Once your account is setup, look for the ‘AdSense setup’ link and then ‘AdSense for Content’, and just follow the helpful instructions. What you’ll be doing is choosing how you the ads will appear on your site. You’ll see previews of sample ads as you go along.

The final step is called ‘Save and Get Code’, and this is where you get the content for your WordPress Text Widget. You’ll see a box full of code on this page which you should just copy and paste into the Text Widget that you created on your blog.

That’s it! There are usually several minutes to wait before you’ll actually see any ads on your page. Google’s servers need to have a cup of coffee and a cigarette after generating your AdSense code. Rather than spoiling Google’s break by irritably refreshing your blog page three times a second for ten minutes, this would be a good time to brew a pot of tea and break out the Bakewell tarts.

Google AdSense up again

June 8th, 2008

I posted an article about a surprise ‘unavailable’ message I got last time I visited Google AdSense. That sort of article really deserves a follow-up, so I checked online and found a useful post at the Digital Point forum that refers to AdSense’s own blog at BlogSpot.

There you can read an article about ‘Site maintenance’. I’m glad to be able to track down some comment from Google’s AdSense team about this issue. But I did have to put some effort into finding out why I couldn’t access my AdSense account – was that really necessary? The page they serve says:

The Google AdSense website is temporarily unavailable.

– well, duh! Tell me something an error 404 wouldn’t!

Please try back later.

– why? Will it be up then? I did try, several times, it was futile.

We apologize for any inconvenience.

– but you don’t explain why you have inconvenienced me.

Would it really have been so difficult to include a link to the blog entry? Or some other Google asset on the web that told me why the site was unavailable, for how long it would be unavailable, and what benefit it is to me? Such an unhelpful ‘site down’ message strikes me as surprisingly lame for such a large organisation.

As for the AdSense blog entry at Blogspot, there is some useful information in there, like when and how long the site will be down for, but I have the following questions:

If it’s regular maintenance, why do you need to tell us? Surely there should be a well-known Google page that lists your regular maintenance service interruptions. Perhaps I’m being pedantic, and they mean regular as in ‘regular fries’ at a fast food shop. As a friendless pedant, I’m always tempted to answer the ‘regular fries?’ question with ‘No, just on this occasion please’. But I don’t, even pedants feel shame. Having a look back through the blog’s previous posts on maintenance, I get the impression there’s no regularity about the maintenance events, so we’ll go with the regular-like-fries explanation.

OK, so if it’s just regular as in common-or-garden maintenance, why less than a day’s notice? I book my car into the garage weeks in advance of it needing regular maintenance. Even if it starts leaking oil, I still book it in at the weekend. To be honest, I only looked back through previous posts to the maintenance post before this one, and saw that it was still less than 24 hours that time.

Why the blasé tone? Google AdSense is a great service, and I can see a lot of effort goes into continuously enhancing it. Which makes the response when things aren’t going so well even more surprising. You do have a great many fans among your customers, but not all of them will appreciate being invited to sing along with your blog post. Some of your more adept and long-term customers may be used to the occasional outage and really not be concerned about it at all. Newer or less confident users won’t feel very helped at all by someone calling them ‘n00b’. Web services support businesses the same way electricity, roads and water do – some people will feel just as upset by the sudden absence of AdSense as they do of any other service.

I feel better now, a good rant always clears the air. Clint Eastwood’s character in The Outlaw Josey Wales sums up my feelings on the AdSense blog post nicely:

“Don’t piss down my back and tell me it’s raining.”

You have a great weekend too.