Metadata-Version: 2.1
Name: dnsmock
Version: 21.2b2
Summary: Python custom resolver
Home-page: https://github.com/imjoseangel/dnsmock
Author: Jose Angel Munoz
Author-email: josea.munoz@gmail.com
License: MIT
Keywords: dns resolver socket
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
License-File: LICENSE

# DNS Mock

[![CodeQL](https://github.com/imjoseangel/dnsmock/workflows/CodeQL/badge.svg)](https://github.com/imjoseangel/dnsmock/security/code-scanning) [![codecov](https://codecov.io/gh/imjoseangel/dnsmock/branch/devel/graph/badge.svg)](https://codecov.io/gh/imjoseangel/dnsmock) [![Python package](https://github.com/imjoseangel/dnsmock/workflows/Python%20package/badge.svg)](https://pypi.org/project/dnsmock)

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

## Requirements

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

## Installation

### Using pip

```bash
pip install dnsmock
```

## Usage example

```python
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](http://github.com/imjoseangel)

## License

Licensed under [the MIT License][2].

[1]: https://imjoseangel.eu
[2]: https://github.com/imjoseangel/dnsmock/blob/devel/LICENSE
[3]: https://docs.python.org/3/library/socket.html


