#!/usr/bin/env python3

# http://inamidst.com/saxo/
# Created by Sean B. Palmer

import subprocess
import saxo

def utf8(arg):
    return arg.decode("utf-8", "replace")

@saxo.command()
def rdns(arg):
    domain = utf8(subprocess.check_output(["dig", "-x", arg, "+short"]))
    return domain.rstrip(".\n") or "No result"
