Skip to content

Repository files navigation

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.

About

Python custom resolver

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages