import socket


def hostname_resolves(hostname):
    """Checks to see if hostname is DNS resolvable"""
    try:
        socket.gethostbyname(hostname)
        return 1
    except socket.error:
        return 0