Useful utilities and services over DNS is a DNS server that takes creative liberties with the DNS protocol to offer handy utilities and services that are easily accessible via the command line.

Copy and run the below commands to try it out.

World time

dig mumbai.time

dig newyork.time

dig paris/fr.time

Pass city names without spaces suffixed with .time. Pass two letter country codes optionally.




dig amsterdam/

Pass city names without spaces suffixed with .weather. Pass two letter country codes optionally. This service is powered by

Unit conversion

dig 42km-mi.unit

dig 32GB-MB.unit

$Value$FromUnit-$ToUnit. To see all 70 available units, dig unit

Currency conversion (forex)

dig 100USD-INR.fx

dig 50CAD-AUD.fx

$Value$FromCurrency-$ToCurrency. Daily rates are from

IP echo

dig ip

Echo your IP address.

Number to words

dig 987654321.words

Convert numbers to English words.

Usable CIDR Range


dig 2001:db8::/108.cidr

Parse CIDR notation to find out first and last usable IP address in the subnet.

Number base conversion

dig 100dec-hex.base

dig 755oct-bin.base

Converts a number from one base to another. Supported bases are hex, dec, oct and bin.


dig pi

dig pi -t txt

dig pi -t aaaa

Print digits of Pi. Yep.

English dictionary

dig fun.dict

dig big-time.dict

Get dictionary definitions for English words. Powered by WordNet®. Replace spaces with dashes.

Rolling dice

dig 1d6.dice

dig 3d20/2.dice

The number of dice to roll, followed by d, followed by the number of sides for each dice, like in tabletop RPG games.

Optionally suffix by /$number to add it to the total. For example, a DnD roll like 2d20+3 is written as 2d20/3.

Tossing coin

dig coin

dig 2.coin

Number of coins to toss.

Random number generation

dig 1-100.rand

dig 30-200.rand

Generate a random number in a specified range (inclusive of the range values).


dig help

Lists available services.

Shortcut function


Add this bash alias to your ~/.bashrc file. The + args show cleaner output from dig.

alias dy="dig +short"


Add this to your fish config file.

alias dy="dig +noall +answer +additional $argv"

Then, use the dy command as a shortcut.

dy berlin.time


dy 100USD-INR.fx


Why not? For fun. I spend a lot of time on the terminal and doing quick unit conversions, weather checks etc. without having to open a clunky search page is useful.