Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Badcow\DNS\Parser\Parser;
- use Badcow\DNS\ZoneBuilder;
- require_once __DIR__ . '/../vendor/autoload.php';
- $example = <<< 'DNS'
- $ORIGIN example.com.
- $TTL 1337
- $INCLUDE hq.example.com.txt
- @ IN SOA (
- example.com. ; MNAME
- post.example.com. ; RNAME
- 2014110501 ; SERIAL
- 3600 ; REFRESH
- 14400 ; RETRY
- 604800 ; EXPIRE
- 3600 ; MINIMUM
- ); This is my Start of Authority Record; AKA SOA.
- ; NS RECORDS
- @ NS ns1.nameserver.com.
- @ NS ns2.nameserver.com.
- info TXT "This is some additional \"information\""
- ; A RECORDS
- sub.domain A 192.168.1.42 ; This is a local ip.
- ; AAAA RECORDS
- ipv6.domain AAAA ::1 ; This is an IPv6 domain.
- ; MX RECORDS
- @ MX 10 mail-gw1.example.net.
- @ MX 20 mail-gw2.example.net.
- @ MX 30 mail-gw3.example.net.
- mail IN TXT "THIS IS SOME TEXT; WITH A SEMICOLON"
- DNS;
- //Parser::parse(string $name, string $zone, bool $retainComments = false): Zone
- $zone = Parser::parse('example.com.', $example, true);
- echo ZoneBuilder::build($zone);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement