Welcome to Machine Unix

Search Below

Alfred Workflow:IPv4 Reverse Resolution

The following is an Alfred Workflow to reverse an IP address with in-addr.arpa appended to it. For example to change the IP address from:

165.225.132.19

to:

132.225.165.in-addr.arpa

One might want to use a workflow like this:

Alfred-Workflow

The Run Script contains the following:

#/bin/bash
IP=”{query}”
SPLIT=`echo $IP | awk -F. ‘{print $3″.”$2″.”$1″.””in-addr.arpa”}’`
echo $SPLIT | pbcopy
echo $SPLIT

and “Copy to Clipboard” contains just the query itself:

{query}

The “Post Notification” also contains {query} as “Text” and an appropriate Title. You enter it like this when you call Alfred:

Reverse

and the result in the notification center looks like this:

Result

The conversion is copied into your clipboard. You can get the workflow here.