Skip to content

Commit

Permalink
cleaned README
Browse files Browse the repository at this point in the history
  • Loading branch information
tccki committed Jun 26, 2013
1 parent 4a0104f commit 99d4e74
Showing 1 changed file with 38 additions and 18 deletions.
56 changes: 38 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ RimuDNS

[RimuHosting](http://rimuhosting.com) Python DNS tools

Documentation for the API can be found [here](https://rimuhosting.com/dns/dyndns.jsp)
and [here](https://zonomi.com/app/dns/dyndns.jsp) for RimuHosting and Zonomi respectively.
Documentation for the API can be found [here](https://rimuhosting.com/dns/dyndns.jsp) and [here](https://zonomi.com/app/dns/dyndns.jsp) for RimuHosting and Zonomi respectively.

The RimuDNS class is a wrapper around the REST API calls.

Installation
------------

easy_install rimudns

or

pip install rimudns
pip install rimudns

Usage
-----

The API key can be generated and replaced in the RimuHosting control panel
from https://rimuhosting.com/cp/apikeys.jsp
The API key can be generated and replaced in the RimuHosting control panel from https://rimuhosting.com/cp/apikeys.jsp

Get started:

```python
#!/usr/bin/env python
from rimudns import RimuDNS
Expand All @@ -31,21 +32,26 @@ dns.use_rimuhosting()
```

List all domains:
```python

```python
for domain in dns.list_zones():
print domain['name']
print domain['name']
```

Create a new domain:

```python
dns.create_zone('example.com')
```

Delete a domain:

```python
dns.delete_zone('example.com')
```
Import a domain from a BIND zone file or string::

Import a domain from a BIND zone file or string:

* IMPORT_AXFR = 1
* IMPORT_FILE = 2
* IMPORT_TEXT = 3
Expand All @@ -54,42 +60,56 @@ Import a domain from a BIND zone file or string::

_for more information about *IMPORT_GUESS* see [Guessing Feature] below._


```python
from rimudns import ZoneHandle
dns.import_zone('example.com', ZoneHandle.IMPORT_FILE, '/tmp/example.com.zone')
```

Export a domain to file:

```python
dnsdns.to_file('/tmp/example.com.zone')
```

Delete a domain:

```python
dns.delete_zone('example.com')
```

List all records for a domain:

```python
records = dns.list_records('example.com')
for record_type in records:
print 'Type: ', record_type
for record in records[record_type]
print 'name: %s -> %s' % (record['name'], record['content')
print 'Type: ', record_type
for record in records[record_type]
print 'name: %s -> %s' % (record['name'], record['content')
```

Add/Update a record::

```python
dns.set_record('example.com', '127.0.0.1', record_type='A', ttl=600)
```

Delete a record::

```python
dns.delete_record('example.com', '127.0.0.1', 'A')
```

Change an IP across all zones::

```python
old_ip = '127.0.0.1'
new_ip = '127.0.0.2'
dns.change_ip(old_ip, new_ip)
```

Convert a zone to slave/back to regular::

```python
dns.convert_to_regular('example.com')
dns.convert_to_slave('example.com')
Expand All @@ -98,19 +118,19 @@ dns.convert_to_slave('example.com')
Web Interface
=============

You can always use the RimuHosting/Zonomi tools to edit your DNS zones
Try: https://rimuhosting.com/dns/
You can always use the [RimuHosting/Zonomi tools](https://rimuhosting.com/dns/) to edit your DNS zones.

Guessing Feature
================
Most of the time you don't have access to AXFR or the Zone File to import the DNS zone directly.
The import_zone offers a _guessing_ feature that tries to build the zone information from DNS queries.
Most of the time you don't have access to AXFR or the Zone File to import the DNS zone directly. The import_zone offers a _guessing_ feature that tries to build the zone information from DNS queries.

You can also provide extra guesses.

```python
extra_guesses = ['mail2', 'test', 'test1']
records = dns.import_zone('funinc.org', ZoneHandle.IMPORT_GUESS, param=extra_guesses, dryrun=True)
for record_type in records:
print 'Type: ', record_type
for record in records[record_type]
print 'name: %s -> %s' % (record['name'], record['content')
print 'Type: ', record_type
for record in records[record_type]
print 'name: %s -> %s' % (record['name'], record['content')
```

0 comments on commit 99d4e74

Please sign in to comment.