Skip to main content

IP filtered DNS Resolver

Project description


Build Status codecov PyPI - Python Version PyPI

This project provide a DNS Resolver for ip blacklist/whitelist and config DNS expire time.


pip install os-scrapy-ipfilter-resolver

You can run example spider directly in the project root path.

scrapy crawl example



  • enable DNS Resolver, in the project file:

    DNS_RESOLVER = "os_scrapy_ipfilter_resolver.Resolver"
  • config IP blacklist, it will raise IPFilteredException when the request ip in the blacklist

    IP_DISALLOWED = ["", ""]
  • config IP whitelist, priority greater than blacklist

    IP_ALLOWED = [""]
  • config DNS cache size and expire time(seconds)

    DNSCACHE_SIZE = 10000
    DNSCACHE_EXPIRE = 24 * 60 * 60
  • config DNS lookup timeout(seconds)

    DNS_TIMEOUT = 60

Unit Tests



MIT licensed.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

os_scrapy_ipfilter_resolver-0.0.2.tar.gz (6.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page