From 390a02580cbe16fa0794de900dc1bbeacb075f69 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 21 May 2008 19:44:37 +0200 Subject: [PATCH] Added support for SRV records. --- README | 7 +++++-- cf.dist/example.com | 17 ++++++++++++----- m4/nsc.m4 | 4 ++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README b/README index aaaac15..00b31e5 100644 --- a/README +++ b/README @@ -231,14 +231,17 @@ ALIAS(alias...) to the current host/domain. TXT(text) - Generate a TXT record for the current host or domain. + Specify a TXT record for the current host or domain. RP(mail, txt) - Generate a RP (responsible person) record for the current host or domain. + Specify a RP (responsible person) record for the current host or domain. The first argument is a mail address in DNS notation (with `@' replaced by `.' as in the SOA record), the second one is a name of a TXT record with contact information. +SRV(service, protocol, priority, weight, port, target) + Specify a SRV (service) record for the current host or domain. + CNAME(src, dest) Generate a CNAME record -- "src" points to "dest". diff --git a/cf.dist/example.com b/cf.dist/example.com index d0f01a8..65f57c7 100644 --- a/cf.dist/example.com +++ b/cf.dist/example.com @@ -11,6 +11,16 @@ SOA(example.com) NS(ns1.example.com, ns2.example.com) MX(0 mail.example.com, 10 smtp.example.net) +; The domain also has its own service record for Jabber, handled by the `mail' machine + +SRV(jabber, tcp, 0, 1, 5269, mail) +SRV(xmpp-server, tcp, 0, 1, 5269, mail) +SRV(xmpp-client, tcp, 0, 1, 5222, mail) + +; Responsible person record (e-mail and reference to textual contact information) + +RP(admin.example.com, text) + ; A couple of hosts H(ns1, 10.0.0.1) @@ -23,15 +33,12 @@ H(www, 10.0.0.3) ALIAS(fairytales, scifi, horror) MX(0 mail.example.com) -; Hosts with TXT and RP records +; TXT record -H(c) +H(text) TXT(Once upon a midnight dreary) TXT(When I pondered weak and weary) -H(d) -RP(admin.example.com, c) - ; A subdomain called a.example.com D(a) diff --git a/m4/nsc.m4 b/m4/nsc.m4 index aa2d4d9..05a7324 100644 --- a/m4/nsc.m4 +++ b/m4/nsc.m4 @@ -127,6 +127,10 @@ define(TXT, `nsc_emit_name `TXT' "$1"') define(RP, `nsc_emit_name `RP' nsc_corr_dot($1) nsc_corr_dot($2)') +# SRV records + +define(SRV, `_`'$1`'._`'$2`'.CURRENT_NAME `SRV' $3 $4 $5 nsc_corr_dot($6)`'nsc_set_name(CURRENT_NAME)') + # CNAME records define(CNAME, `$1 `CNAME' nsc_corr_dot($2)') -- 2.39.2