Skip to content

importpw/dns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dns

DNS resolution functions for shell scripting.

API

dns_lookup $hostname

Performs a DNS lookup for $hostname. The difference between this function and dns_resolve is that this version uses the operating system native DNS resolution mechanism, so hostnames like localhost resolve as expected.

#!/usr/bin/env import
import dns

# Resolve `localhost` to an IP address
dns_lookup localhost

dns_resolve $hostname [$record_type = "A"]

Performs a DNS lookup for $hostname. This function performs a DNS query, so an actual DNS record needs to exist. $record_type may be specified for the type of DNS record to query for.

#!/usr/bin/env import
import dns

# Query the `A` records
dns_resolve import.pw

# Query the `MX` records
dns_resolve import.pw MX

dns_reverse $ip

Performs a reverse DNS lookup on IP address $ip.

#!/usr/bin/env import
import dns

dns_reverse 8.8.8.8

About

DNS resolution functions for shell scripts

Resources

License

Stars

Watchers

Forks

Packages

No packages published