Skip to main content

Python library to interact with public DNS servers

Project description

## PubDNS
[![Build Status](https://travis-ci.org/mehrdadrad/pubdns.svg?branch=master)](https://travis-ci.org/mehrdadrad/pubdns)
[![PyPI pyversions](https://img.shields.io/badge/python-2.6,%202.7,%203.4,%203.5,%203.6-blue.svg)](https://pypi.python.org/pypi/pubdns/)
[![PyPI license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mehrdadrad/pubdns/blob/master/LICENSE)
[![PyPI](https://badge.fury.io/py/pubdns.svg)](https://pypi.python.org/pypi/pubdns)
[![Documentation Status](https://readthedocs.org/projects/pubdns/badge/?version=latest)](http://pubdns.readthedocs.io/en/latest/?badge=latest)

pubdns is a library for python to have more than 28K public dns servers from 190+ countries at your python script. it works based on the public-dns.info collected data and there is a wrapper based on the dnspython to resolve all type of dns records through these public dns server smoothly.

### Quick start

```python
import pubdns
pd = pubdns.pubdns()
servers = pd.servers('US', 'los angeles')
```

### Sample data

```
[
{
'city': 'Los Angeles',
'server': '12.127.16.67',
'name': 'rmtu.mt.rs.els-gms.att.net.',
'reliability': '1.00'
},
{
'city': 'Los Angeles',
'server': '216.240.32.77',
'name': 'dns2.worldpassage.net.',
'reliability':'1.00'
},
...
]
```

### Sample DNS Query

```python
rs = pubdns.dns.resolver(servers, 'amazon.com', ['A'])
for r in rs:
print(r)
```

### Sample Data

```
{
'server':
{
'city': 'Los Angeles',
'server': '12.127.16.67',
'name': 'rmtu.mt.rs.els-gms.att.net.',
'reliability': '1.00'
},
'resolve': [
{'name': '176.32.98.166', 'type': 'A'},
{'name': '176.32.103.205', 'type': 'A'},
{'name': '205.251.242.103', 'type': 'A'}
]
}
```

## Feature Support

- Search by country and city
- Cache public-dns.info data and update with specific TTL
- Support HTTP proxy to get public dns data
- Query the public DNS with specific record type(s)

## Requirements

Python 2.6 or later.

## Installation

```
pip install pubdns
```

## License

This project is licensed under MIT license. Please read the LICENSE file.


## Contribute

Welcomes any kind of contribution, please follow the next steps:

- Fork the project on github.com.
- Create a new branch.
- Commit changes to the new branch.
- Send a pull request.

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

pubdns-0.1.4.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file pubdns-0.1.4.tar.gz.

File metadata

  • Download URL: pubdns-0.1.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pubdns-0.1.4.tar.gz
Algorithm Hash digest
SHA256 63eefd6b9f1357892e11a388c9a5e37d01ea16d629b9361c61e2d67198ea8649
MD5 606ad1cfb19b3ed426759ab420b33e14
BLAKE2b-256 fd386cd1ecf3ea4a2d9cdae9a8f3fe6507adb06d54a2176b08287a3c6e93bf26

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