dns resolver

mail@pastecode.io avatar
unknown
plain_text
2 years ago
678 B
5
Indexable
Never
import dnspython as dns
import dns.resolver


def dns_cb(data, buffer, args):
    network = signal.split(",", maxsplit=1)[0]
    nick = address.split("!", maxsplit=1)[0]
    args = signal_data.split(' ')[0:3]
    host = args[0][1:].split('!')[1].split('@')[1]
    buffer = weechat.info_get("irc_buffer", f"{network},{msg['channel']}")
    result = dns.resolver.query('host', 'A')
    if active_buffer.lower() == chan_buffer.lower():

        weechat.prnt("", f"User {host} resulted in: {result}")

    return weechat.WEECHAT_RC_OK

weechat.register("dns_script", "rxtx", "0.0.1", "BSD-0", "dns resolver script", "", "")

weechat.hook_command('dns', '', '', '', '', 'dns_cb', '')