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.

Requirements

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

Installation

Using pip

pip install dnsmock

Usage example

import dnsmock
import requests

dnsmock.bind_ip('www.example.com', 443, '127.0.0.1')
response = requests.get('https://www.example.com', verify=True)

print(response.text)

Authors

Originally created by @imjoseangel

License

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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file dnsmock-21.2b2.tar.gz.

File metadata

  • Download URL: dnsmock-21.2b2.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for dnsmock-21.2b2.tar.gz
Algorithm Hash digest
SHA256 e590b2322690b14fc8f2eb0e0f1ec655828554f8254ed71c8f4ee07e2be04359
MD5 e426447d8c57a04777a2bd124c00f9e2
BLAKE2b-256 8ea8e5179563bc971f17d144c72500bc65f5a206cd0ba54c92961d09bdb0df22

See more details on using hashes here.

File details

Details for the file dnsmock-21.2b2-py2.py3-none-any.whl.

File metadata

  • Download URL: dnsmock-21.2b2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for dnsmock-21.2b2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 df94f69840ad9b7db9a22e069d3a4db8fe57b022b02f779e4d3682738dbb7e19
MD5 04774ea6cb5c8e5e06472c7dbaef0c21
BLAKE2b-256 db7d59207986ec950aeefd05bca61a0d275aa56add6949fdbd0cba8832f18285

See more details on using hashes here.

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