To use the service with your domain name, you need to make sure you set the nameservers to:
ns0.portfast.netns1.portfast.netns2.portfast.net.uk
In Master mode, the servers are the authoritative source for your domain. The zone can be edited via the control panel and changes will be automatically propagated throughout the cluster.
You can add your own access list to permit zone transfers out, and notify packets will be sent to the nameservers in the 'NS' section of the zone when you cause an update.
In Slave mode, our servers will copy the zone from a master of your choice. You specify this master by IP address in the "DNS editor" section of the site. You can use an IPv4 or IPv6 address as the master.
If you are using IPv4, then you will need to permit transfers from:
193.108.199.13085.158.46.77213.5.89.46
If you are using IPv6, then you will need to permit transfers from:
2001:67c:1b8:53::22001:4b10:100:8::532a03:9800:0:52::2
We will email you in advance if any of these addresses need to change.
The name server will request a new copy of the zone if you send it a DNS notify packet. This packet must come from the same address that you have specified above, otherwise it will be ignored, so pay special attention if your source name server is behind NAT.
The DNS API endpoint is https://www.portfast.co.uk/api/dns. All requests require authentication using an API key in the X-Portfast-Key header. All DNS operations require a zone parameter specifying the domain name to operate on.
Name server groups allow you to define reusable groups of nameservers for your domains.
Node: /ns_groups
GET - List all name server groups:
Query:
$ curl https://www.portfast.co.uk/api/dns/ns_groups -s -H "X-Portfast-Key: $(cat ~/.portfast-key)" | jq
Response:
[
{
"uuid": "abc123...",
"label": "My Nameservers",
"nameservers": ["ns1.example.com", "ns2.example.com"]
}
]
POST - Create a new name server group:
Request:
{
"label": "My Nameservers",
"nameservers": ["ns1.example.com", "ns2.example.com"]
}
Query:
$ curl https://www.portfast.co.uk/api/dns/ns_groups -X POST -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"label":"My Nameservers","nameservers":["ns1.example.com","ns2.example.com"]}' | jq
Response:
{
"uuid": "abc123...",
"label": "My Nameservers",
"nameservers": ["ns1.example.com", "ns2.example.com"]
}
GET - Get details of a specific group (replace UUID with the group UUID):
Query:
$ curl https://www.portfast.co.uk/api/dns/ns_groups/UUID -s -H "X-Portfast-Key: $(cat ~/.portfast-key)" | jq
PUT - Update a name server group:
Request:
{
"label": "Updated Nameservers",
"nameservers": ["ns1.example.com", "ns2.example.com", "ns3.example.com"]
}
Query:
$ curl https://www.portfast.co.uk/api/dns/ns_groups/UUID -X PUT -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"label":"Updated Nameservers","nameservers":["ns1.example.com","ns2.example.com","ns3.example.com"]}' | jq
DELETE - Delete a name server group:
Query:
$ curl https://www.portfast.co.uk/api/dns/ns_groups/UUID -X DELETE -H "X-Portfast-Key: $(cat ~/.portfast-key)" | jq
Manage whether a zone is in local (master) or remote (slave) mode.
Node: /zones/{zone}/source
GET - Get zone source information:
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/source -s -H "X-Portfast-Key: $(cat ~/.portfast-key)" | jq
Response:
{
"source": "local"
}
For remote zones, the response includes the master IP:
Response:
{
"source": "remote",
"master": "192.0.2.25"
}
Retrieve zone record data.
Node: /zones/{zone}/records
GET - Get zone records as JSON array:
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/records -s -H "X-Portfast-Key: $(cat ~/.portfast-key)" | jq
Response:
[
{
"id": 123,
"zone": 456,
"ttl": 3600,
"type": "A",
"resource": "www",
"content": "192.0.2.1",
"priority": null,
"weight": null,
"port": null,
"flags": null,
"tag": null
}
]
Node: /zones/{zone}/raw
GET - Get zone in raw BIND format:
Query with text output:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/raw -s -H "X-Portfast-Key: $(cat ~/.portfast-key)" -d '{"text":true}'
Add and delete DNS records.
Node: /zones/{zone}/records
POST - Create a new DNS record:
Request:
{
"resource": "www",
"type": "A",
"content": "192.0.2.1",
"ttl": 3600,
"priority": null,
"weight": null,
"port": null,
"flags": null,
"tag": null
}
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/records -s -X POST -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"resource":"www","type":"A","content":"192.0.2.1","ttl":3600}' | jq
Response:
{}
All fields except content are optional. The ttl defaults to 3600 if not specified.
DELETE - Delete DNS records by ID:
Request:
{
"id": 123
}
Or delete multiple records:
Request:
{
"id": [123, 456, 789]
}
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/records -s -X DELETE -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"id":123}' | jq
Response:
{}
DELETE - Delete DNS records by resource name:
Request:
{
"resource": "www"
}
Or delete multiple resources:
Request:
{
"resource": ["www", "mail", "ftp"]
}
Manage Start of Authority (SOA) record parameters.
Node: /zones/{zone}/soa
POST - Set SOA parameters:
Request:
{
"mname": "ns1.example.com",
"rname": "admin@example.com",
"serial": 2024010101,
"refresh": 3600,
"retry": 600,
"expire": 604800,
"minimum": 86400
}
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/soa -s -X POST -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"mname":"ns1.example.com","rname":"admin@example.com","serial":2024010101,"refresh":3600,"retry":600,"expire":604800,"minimum":86400}' | jq
Response:
{}
All parameters are required. The rname field accepts the format admin@example.com (the @ will be converted to a dot).
GET - Get SOA record from a specific server:
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/soa -s -H "X-Portfast-Key: $(cat ~/.portfast-key)" -d '{"server":"ns1.portfast.net"}' | jq
Response:
{
"mname": "ns1.portfast.net",
"rname": "hostmaster.example.com",
"serial": 2024010101,
"refresh": 3600,
"retry": 600,
"expire": 604800,
"minimum": 86400
}
Change whether a zone is in local (master) or remote (slave) mode.
Node: /zones/{zone}/source
POST - Set zone source mode:
For local (master) mode:
Request:
{
"source": "local",
"clear_existing": false
}
For remote (slave) mode:
Request:
{
"source": "remote",
"master": "192.0.2.25"
}
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/source -s -X POST -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"source":"local"}' | jq
Response:
{}
Manage permitted hosts for zone transfers.
Node: /zones/{zone}/axfr
GET - List permitted AXFR hosts:
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/axfr -s -H "X-Portfast-Key: $(cat ~/.portfast-key)" | jq
Response:
[
"192.0.2.1",
"192.0.2.2"
]
POST - Add a permitted AXFR host:
Request:
{
"host": "192.0.2.100"
}
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/axfr -s -X POST -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"host":"192.0.2.100"}' | jq
Response:
[
"192.0.2.100"
]
Node: /zones/{zone}/axfr/{host}
DELETE - Remove a permitted AXFR host:
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/axfr/192.0.2.100 -s -X DELETE -H "X-Portfast-Key: $(cat ~/.portfast-key)" | jq
Response: HTTP 204 No Content
Request a zone transfer from the master server.
Node: /zones/{zone}/retransfer
POST - Retransfer zone from master:
Request:
{
"server": "192.0.2.25"
}
Query:
$ curl https://www.portfast.co.uk/api/dns/zones/example.com/retransfer -s -X POST -H "X-Portfast-Key: $(cat ~/.portfast-key)" -H "Content-Type: application/json" -d '{"server":"192.0.2.25"}' | jq
Response: HTTP 204 No Content