'Create a new zone.
:param domain: Zone domain name (e.g. example.com)
:type domain: ``str``
:param type: Zone type (master / slave) (does nothing).
:type  type: ``str``
:param ttl: TTL for new records. (does nothing)
:type  ttl: ``int``
:param extra: Extra attributes (to set ip). (optional)
Note: This can be used to set the default A record with
{"ip" : "IP.AD.DR.ESS"} otherwise 127.0.0.1 is used
:type extra: ``dict``
:rtype: :class:`Zone`'

def create_zone(self, domain, type='master', ttl=None, extra=None):

    params = {'name': domain}
    try:
        params['ip_address'] = extra['ip']
    except:
        params['ip_address'] = '127.0.0.1'
    res = self.connection.request('/v2/domains', params=params, method='POST')
    return Zone(id=res.object['domain']['name'], domain=res.object['domain']['name'], type='master', ttl=1800, driver=self, extra={})
