{"id":6680,"library":"ipwhois","title":"ipwhois","description":"ipwhois is a Python package designed for retrieving and parsing whois data for both IPv4 and IPv6 addresses. It is currently at version 1.3.0 and actively maintained, though its release cadence can be irregular.","status":"active","version":"1.3.0","language":"en","source_language":"en","source_url":"https://github.com/secynic/ipwhois","tags":["whois","ip","ipv4","ipv6","network","rdap","asn","security"],"install":[{"cmd":"pip install ipwhois","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for DNS-based lookups and ASN information.","package":"dnspython","optional":false},{"reason":"Added as a security requirement (for Python 3.4+).","package":"defusedxml","optional":false}],"imports":[{"note":"The main class is directly importable from the top-level package.","wrong":"from ipwhois.ipwhois import IPWhois","symbol":"IPWhois","correct":"from ipwhois import IPWhois"}],"quickstart":{"code":"from ipwhois import IPWhois\nfrom pprint import pprint\n\n# Using a public IP for demonstration\nip_address = '74.125.225.229'\n\n# Initialize IPWhois object\nobj = IPWhois(ip_address)\n\n# Perform RDAP lookup (recommended method)\n# depth=1 retrieves top-level network information\n# For more recursive lookups, increase depth\nresults = obj.lookup_rdap(depth=1)\n\npprint(results)","lang":"python","description":"This quickstart demonstrates how to perform a basic RDAP lookup using the IPWhois class. RDAP (Registration Data Access Protocol) is the recommended method for retrieving data. The `depth` parameter controls how many recursive lookups are performed for associated entities."},"warnings":[{"fix":"Migrate to `IPWhois.lookup_whois()` for legacy WHOIS queries or, preferably, `IPWhois.lookup_rdap()` for RDAP queries, which offers a better data structure.","message":"The `IPWhois.lookup()` method was deprecated in older versions (around 0.15.0) and completely removed in v1.0.0. Calling it will result in an AttributeError or similar failure.","severity":"breaking","affected_versions":"< 1.0.0"},{"fix":"Refer to the v1.2.0 changelog and upgrade notes for a full list of removed components and their replacements. For ASN lookups, refer to the `IPASN` class and its current methods.","message":"Version 1.2.0 removed several previously deprecated functions and parameters, including `asn.IPASN._parse_fields_*`, `net.Net.lookup_asn`, `asn_alts`, and `allow_permutations`. Code relying on these will break.","severity":"breaking","affected_versions":">= 1.2.0"},{"fix":"Upgrade `ipwhois` to version 1.3.0 or later to ensure compatibility with recent `dnspython` versions.","message":"If you are using an older version of `ipwhois` with a newer version of `dnspython`, you might encounter issues related to deprecated `dnspython` query methods. `ipwhois` v1.3.0 addressed this compatibility.","severity":"gotcha","affected_versions":">= 1.2.0, < 1.3.0 with newer dnspython"},{"fix":"Implement proper caching mechanisms for WHOIS data, introduce delays between queries, or consider using experimental bulk query support (with caution) if applicable.","message":"Frequent or excessive queries, particularly against services like LACNIC, can lead to rate limiting based on your source IP, resulting in latency or blocked requests.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If experiencing performance or rate-limiting issues, set `root_ent_check=False` in `lookup_rdap()` to revert to the older functionality with fewer queries (but potentially less data).","message":"The `root_ent_check` argument in `IPWhois.lookup_rdap()` (introduced in v1.2.0) defaults to `True`. While this provides more complete data, it can significantly increase the number of queries and potentially trigger rate-limiting.","severity":"gotcha","affected_versions":">= 1.2.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}