Skip to main content

Python custom resolver

Project description

DNS Mock

CodeQL codecov Python package

Python DNS Mock to bypass current DNS resolution. Emulates /etc/hosts inside a container.


The dnsmock segment requires the standard library module socket. It provides access to the BSD socket interface.


Using pip

pip install dnsmock

Usage example

import dnsmock
import requests

dnsmock.bind_ip('', 443, '')
response = requests.get('', verify=True)



Originally created by @imjoseangel


Licensed under the MIT License.

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

dnsmock-21.2b2.tar.gz (16.8 kB view hashes)

Uploaded source

Built Distribution

dnsmock-21.2b2-py2.py3-none-any.whl (5.5 kB view hashes)

Uploaded py2 py3

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