1import requests
2
3url = "https://api.whoisfreaks.com/v2.0/dns/live?apiKey=API_KEY&domainName=whoisfreaks.com&ipAddress=8.8.8.8&type=all"
4response = requests.get(url)
5print(response.text)1import requests
2
3url = "https://api.whoisfreaks.com/v2.0/dns/historical?apiKey=API_KEY&domainName=whoisfreaks.com&type=all&page=1"
4response = requests.get(url)
5print(response.text)1import requests
2
3url = "https://api.whoisfreaks.com/v2.1/dns/reverse?apiKey=API_KEY&format=json&value=8.8.8.8&type=a"
4response = requests.get(url)
5print(response.text)1import requests
2
3url = "https://api.whoisfreaks.com/v2.0/dns/bulk/live?apiKey=API_KEY&type=all&format=json"
4headers = {
5 "Content-Type": "application/json",
6}
7payload = '{"domainNames": ["whoisfreaks.com","jfreaks.com"],"ipAddresses": ["1.1.1.1","8.8.8.8"]}'
8response = requests.get(url, data=payload, headers=headers)
9print(response.text)The SDK enables live, historical, and reverse DNS lookups, allowing you to access detailed DNS records essential for network analysis, troubleshooting, and verifying domain configurations. It’s an ideal tool for developers handling DNS data and performing network diagnostics.
This package is for performing any type of DNS lookup, such as live, historical, or reverse lookups.
To utilize the WhoisFreaks Python SDK for DNS Lookups of domain names or IP addresses, follow these steps:
First, ensure that Python and the WhoisFreaks Python SDK are installed on your system. To install the necessary modules, please visit the Installation Steps page.
In all lookups, replace "your_api_key" with your actual API key.
live_dns_lookup performs a live DNS lookup using the WhoisFreaks API. It retrieves real-time DNS information for a specific domain or an IP address.
live_dns_lookup(type='all', api_key='your_api_key', domain_name='example.com', ip_address='1.1.1.1')Parameters:
Returns:
Note: You can enter a domain name, an IPv4 address, or both. For a domain name, all available records of these 8 DNS types will be fetched: A, AAAA, MX, NS, SPF, SOA, TXT, and CNAME. For an IP address, only the PTR record will be fetched.
For complete details on the response fields, please visit the DNS Live Documentation.
Example Usage:
from whoisfreaks import WhoisfreaksApi
from whoisfreaks.core.api_error import ApiError
client = WhoisfreaksApi()
try:
response = client.live_dns_lookup(type='all', api_key='your_api_key', domain_name='example.com', ip_address='1.1.1.1')
response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values
print(response)
except ApiError as e:
print(e.body)Replace example.com with your specific domain name and 1.1.1.1 with the IP address you wish to query.
bulk_dns_lookup fetches live DNS data for multiple domains or IP addresses at once using WhoisFreaks' DNS Bulk Lookup module. Keep in mind that each request supports up to 100 domains and 100 IPs. To perform lookups for more than 100 domains or IP addresses, you can contact us or sign in and upload a file for bulk processing. Files can contain over 100 entries, with a maximum limit of 3,000,000.
bulk_dns_lookup(type='all', api_key='your_api_key', domain_names=['domain1.com', 'domain2.com'], ip_addresses=['1.1.1.1', '8.8.8.8'])Parameters:
Returns:
Note: You can provide a list of domain names, IPv4 addresses, or both for bulk DNS lookup. For each domain name, all available records of the following 8 DNS types will be retrieved: A, AAAA, MX, NS, SPF, SOA, TXT, and CNAME. For each IPv4 address, only the PTR record will be returned.
For complete details on the response fields, please visit the DNS Bulk Lookup Documentation.
Example Usage:
from whoisfreaks import WhoisfreaksApi
from whoisfreaks.core.api_error import ApiError
client = WhoisfreaksApi()
try:
response = client.bulk_dns_lookup(type='all', api_key='your_api_key', domain_names=['domain1.com', 'domain2.com'], ip_addresses=['1.1.1.1', '8.8.8.8'])
response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values
print(response)
except ApiError as e:
print(e.body)Replace the domain names and IP addresses with your specific values.
historical_dns_lookup uses the WhoisFreaks Python SDK's historical function to retrieve historical DNS records for a given domain and DNS record type.
historical_dns_lookup(type='all', api_key='your_api_key', domain_name='example.com')Parameters:
Returns:
For a comprehensive details of response fields, you can visit the DNS Historical's documentation.
Example Usage:
from whoisfreaks import WhoisfreaksApi
from whoisfreaks.core.api_error import ApiError
client = WhoisfreaksApi()
try:
response = client.historical_dns_lookup(type='all', api_key='your_api_key', domain_name='example.com')
response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values
print(response)
except ApiError as e:
print(e.body)Replace "example.com" with the domain you wish to query, adjust type as needed, and specify the page number if necessary.
reverse_dns_lookup is used to get data for reverse DNS lookup of any value based on its type.
reverse_dns_lookup(api_key='your_api_key', type='a', value='1.1.1.1')Parameters:
Returns:
Note: The value you enter must correspond to the DNS type. For example, for the aaaa type, the value should be an IPv6 address like 2001:db8::1. For the ns type, the value should be a nameserver such as ns1.google.com.
For detailed info about the response fields, you can visit the Reverse DNS Lookup's documentation.
Example Usage:
from whoisfreaks import WhoisfreaksApi
from whoisfreaks.core.api_error import ApiError
client = WhoisfreaksApi()
try:
response = client.reverse_dns_lookup(api_key='your_api_key', type='a', value='1.1.1.1')
response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values
print(response)
except ApiError as e:
print(e.body)Replace "1.1.1.1" with the IP address you wish to query, adjust dns type as needed, and specify the page number if necessary.
Offers live, reverse, historical, IP, ASN, and bulk domain WHOIS lookups.
Provides live, reverse, historical, and bulk DNS lookup services.
Checks domain availability across TLDs and suggests alternatives.
Performs SSL lookup and shows certificate chain from start to present.

Use this powerful Python-based SDK to easily integrate, interact with, and manage data from the WhoisFreaks API seamlessly.
whoisfreaks.docs.buildwithfern.com