Category Archives: Tools

My tweet you just read says the long story short. In case you didn’t come across, Google made DNS a buzzing topic again with Google Public DNS. So I felt like trying a dns cache again. The logic is “If a better DNS server makes things better, DNS cache makes it even better.”

This is more of a note to self than a HOWTO. If your use case atches with mine, feel free to use this.

My use case: I use an HSDPA, mobile broadband connection on Ubuntu 9.04 Jaunty Jackalope.

Install pdnsd with,

$sudo apt-get install pdnsd

Now launch the text editor you hate and add following to /etc/pdnsd.conf

(By default all the parts are commented so just adding this was fine enough for me)


server {
ip=208.67.222.222 , 8.8.8.8;
timeout=5;
interval=30;
uptest=ping;
ping_timeout=50;
purge_cache=off;
}

global {
 perm_cache=5120;
 cache_dir="/var/cache/pdnsd";
 min_ttl=15m;       // Retain cached entries at least 15 minutes.
 max_ttl=1w;        // One week.
 timeout=10;        // Global timeout option (10 seconds).
}

I copied this piece from here and edited ;). Added the global field because defaults were not cool enough for me. And in ip field I’ve put respectively OpenDNS and Google DNS addresses. You can just add one address there. ‘man pdnsd.conf’ will teach you more about the content in the file.

Once you are done editing the configuration file restart pdnsd with

$sudo /etc/init.d/pdnsd restart

Now you should tell the network manager to look for pdnsd for it’s DNS needs.

Right click network manager icon and then follow Edit Connections > Mobile Broadband and choose to edit your preferred network connection.

In Editing <Your Network Connection> dialog box,
[1] Choose IPv4 Settings tab
[2] Choose Automatic Addresses (ppp) Only in Methods Dropdown box.
[3] Set DNS Servers field to 127.0.0.1 (which refers to pdnsd in our case)

And obviously, Apply Changes :P .

If everything went fine, you are now ready to enjoy DNS cache goodness with pdnsd.

You can check how good is it with dig command.

ex:
$dig yahoo.com

run this command twice and compare Query time field.

Note: If you followed all the steps but still it doesn’t work, try restarting pdnsd. If you get following error refer this page

/etc/resolv.conf must be a symlink

Update: Added the global settings for config file.

I found This nice howto via @meaningful. Looks like the howto is for older version of Twitterfox. Here goes how to do it on Twitterfox 1.8.1 (The version I use right now)

And I recommend you to update to Twitterfox 1.8.1 coz it’s really improved.

First go here:

<path to your Firefox profile directory>/extensions/twitternotifier@naan.net/chrome

[you'll learn howto find your Firefox profile directory (AKA folder) here. There are too many operating systems. I can't cover them all :P  ]

There is a file called TwitterFox.jar

Open it & go in to directory called content. There you’ll find the file called twitterfox.js, you better open it with a text editor.

In the top region of the file you’ll find TINYURL_CREATE_API variable. it is set to use tinyurl api by default. I edited it to use my favorite URL shortnet tr.im by editing it to look like this.

var TINYURL_CREATE_API = “http://tr.im/api/trim_simple?url=”;

You can repalce http://tr.im/api/trim_simple?url= with the API of your favorite URL shortner.

You need to restart Firefox for the changes to be effective.

Hope it works ;) . Anything not clear? Just ask in comments.

PS: You may not like to try this but I don’t give a shit :P .

It’s over. The fight against the dynamic DNS is over for me now. It took me so long to figure this simple thing out. But I don’t worry, even the big bro Goog couldn’t come up with a satisfying straight answer for my problem. So I myself searched under the mattress & found the pea which took my good night sleep (I’m neither a princess nor prince ;) ).

Sometimes back I had to come up with a pretty shitty solution for a shitty problem. No I didn’t won’t to show how bad my thinking or coding is. But wanted to show how shitty is the service of my ISP. But however the right way to fix all those are here with me. And I’m gonna share it with you.

If you use wvdial to dial up (Ok, now only seven people at most will continue reading this) for your internet connection, and you hate the DNS servers come your way automagically, here’s what to do.

Open /etc/ppp/peers/wvdial with your favorite text editor & comment the line usepeerdns. I mean make it look like #usepeerdns. Now wvdial won’t ask pppd to fetch those crappy DNS addresses again.

So go and edit your /etc/resolv.conf file and add you favorite DNS servers there. Mine looks like following.

nameserver 127.0.0.1
nameserver 208.67.222.222
nameserver 208.67.220.220

Wonder why I use 127.0.0.1 there? That’s because I’m a happy user of dnsmasq (I recommend you to use it). I used this simple HOWTO to install it on Ubuntu. There should be other guides & HOWTOs which might match you (In case that one doesn’t fit). Just ask big bro Goog.

And other nameservers are of the nice free DNS service OpenDNS.

It’s today I found this new URL shortening service tinyarro.ws. It gives you http://➡.ws/blah as the shortened url(yeah.. blah is a random string or you can choose what you like).

I really liked the idea & thought of altering my previously created trim ubiquity command and make a ubiquity command for tinyarro.ws. You can get ubiquity here . If you don’t not know what is ubiquity you can learn more here.

> Install arrow – Ubiquity command <

(If you have ubiquity installed you get a dialog to install the command on top of the page)

OK fellas keep sending tiny arrows :D .

BTW: Tinyarrow for this blog post is http://➡.ws/⇷

Update: tinyarro.ws URLs might not work properly everywhere. Just keep an I on the discussion going on here.

URL shortening is very popular these days. There are so many service which would shorten a long url for you. Here is a tool which would shorten a URL with ubiquity using tr.im service.

Aren’t you using ubiquity? believe me it’s so fresking cool & very productive. learn more here. Get ubiquity here.

And tr.im is the url shortner I love. It gives one of shortest URLs & it sounds cool. That’s all.

Why my own command?
Just because I couldn’t find a tr.im ubiquity command on big web & still I love tr.im. There are so many url shortener ubiquity commands out there. There’s the built in tinyurl command in ubiquity & a command supports multiple services. But I <3 my command :).

Make sure you have ubiquity & click following link, Ubiquity will install it for you.

Subscribe to trim ubiquity command here.