Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
12879324c6 | |||
fc2031eb7c | |||
17ff01d066 | |||
7a3e5e472a |
20
README.md
20
README.md
@ -65,15 +65,29 @@ zones:
|
|||||||
- 10 mta2.example.com
|
- 10 mta2.example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Aliases virtual type
|
||||||
|
There is a virtual record type `aliases` which is a list of names to CNAME to this record.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
zones:
|
||||||
|
example.com:
|
||||||
|
"@":
|
||||||
|
A: 10.54.22.9
|
||||||
|
aliases:
|
||||||
|
- www
|
||||||
|
- ftp
|
||||||
|
```
|
||||||
# Running
|
# Running
|
||||||
Invoke the docker container with the input yaml file:
|
Invoke the docker container with the input yaml file:
|
||||||
```bash
|
```bash
|
||||||
docker run --rm -ti -v "${PWD}:/a" -w /a fooflington/mythic-beasts-dns mafoo.org.uk.yml
|
docker run --rm -ti -v "${PWD}:/a" -w /a fooflington/mythic-dns mafoo.org.uk.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dry run
|
## Dry run
|
||||||
Pass the environment variable `DRY_RUN` to prevent any changes:
|
Pass the environment variable `DRY_RUN` to prevent any changes:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm -ti -v "${PWD}:/a" -w /a -e DRY_RUN=1 fooflington/mythic-beasts-dns mafoo.org.uk.yml
|
docker run --rm -ti -v "${PWD}:/a" -w /a -e DRY_RUN=1 fooflington/mythic-dns mafoo.org.uk.yml
|
||||||
```
|
```
|
||||||
|
@ -40,9 +40,9 @@ my %supported_types = (
|
|||||||
MX => "yes",
|
MX => "yes",
|
||||||
NS => "yes",
|
NS => "yes",
|
||||||
PTR => "yes",
|
PTR => "yes",
|
||||||
SSHFP => "not yet implemented",
|
SSHFP => "yes",
|
||||||
SRV => "yes",
|
SRV => "yes",
|
||||||
TLSA => "not yet implemented",
|
TLSA => "yes",
|
||||||
TXT => "yes",
|
TXT => "yes",
|
||||||
);
|
);
|
||||||
sub is_unsupported($) {
|
sub is_unsupported($) {
|
||||||
@ -136,6 +136,17 @@ sub format_record($$$$) {
|
|||||||
$record->{caa_property} = $property;
|
$record->{caa_property} = $property;
|
||||||
$record->{caa_tag} = $property;
|
$record->{caa_tag} = $property;
|
||||||
$record->{data} = $data;
|
$record->{data} = $data;
|
||||||
|
} elsif ($type eq 'SSHFP') {
|
||||||
|
my ($algo, $keytype, $data) = split(/\s+/, $value);
|
||||||
|
$record->{sshfp_type} = $keytype;
|
||||||
|
$record->{sshfp_algorithm} = $algo;
|
||||||
|
$record->{data} = $data;
|
||||||
|
} elsif ($type eq 'TLSA') {
|
||||||
|
my ($usage, $selector, $matching, $data) = split(/\s+/, $value);
|
||||||
|
$record->{tlsa_usage} = $usage;
|
||||||
|
$record->{tlsa_selector} = $selector;
|
||||||
|
$record->{tlsa_matching} = $matching;
|
||||||
|
$record->{data} = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $record;
|
return $record;
|
||||||
@ -158,6 +169,19 @@ sub reformat_data($$) {
|
|||||||
$data->{caa_property} || $data->{caa_tag},
|
$data->{caa_property} || $data->{caa_tag},
|
||||||
$data->{data}
|
$data->{data}
|
||||||
);
|
);
|
||||||
|
} elsif($type eq 'SSHFP') {
|
||||||
|
return sprintf('%d %d %s',
|
||||||
|
$data->{sshfp_algorithm},
|
||||||
|
$data->{sshfp_type},
|
||||||
|
$data->{data},
|
||||||
|
);
|
||||||
|
} elsif($type eq 'TLSA') {
|
||||||
|
return sprintf('%d %d %d %s',
|
||||||
|
$data->{tlsa_usage},
|
||||||
|
$data->{tlsa_selector},
|
||||||
|
$data->{tlsa_matching},
|
||||||
|
$data->{data},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data->{data};
|
return $data->{data};
|
||||||
|
Reference in New Issue
Block a user