<% set error "" set type "" set record "" array set q { type {} format html rpdomain {} rpmbox {} rptxt {} srvservice {} srvpriority 0 srvweight 0 srvport {} srvtarget {} txtdomain {} txttext {} } if {[ns_getform] != ""} { getform q set code [catch { if {[info exists q(make-rp)]} { set rpdomain [djbdns::validateAndNormalizeDotted \ $q(rpdomain)] set rpmbox [djbdns::validateAndNormalizeDotted $q(rpmbox)] set rptxt [djbdns::validateAndNormalizeDotted $q(rptxt)] set record ":[djbdns::escapeName $rpdomain]:17:[djbdns::dottedToRR $rpmbox][djbdns::dottedToRR $rptxt]" set type RP } elseif {[info exists q(make-srv)]} { set srvservice [djbdns::validateAndNormalizeDotted \ $q(srvservice)] set srvpriority [djbdns::validate16bit $q(srvpriority) Priority] set srvweight [djbdns::validate16bit $q(srvweight) Weight] set srvport [djbdns::validate16bit $q(srvport) Port] set srvtarget [djbdns::validateAndNormalizeDotted \ $q(srvtarget)] set record ":[djbdns::escapeName $srvservice]:33" append record ":[djbdns::16bitToRR $srvpriority]" append record "[djbdns::16bitToRR $srvweight]" append record "[djbdns::16bitToRR $srvport]" append record "[djbdns::dottedToRR $srvtarget]" set type SRV } elseif {[info exist q(make-txt)]} { set txtdomain [djbdns::validateAndNormalizeDotted \ $q(txtdomain)] set txttext [djbdns::escapeBinary \ [encoding convertto utf-8 $q(txttext)]] set record "'$txtdomain:$txttext" set type TXT } } result] if {$code == 1} { global errorCode errorInfo if {![string equal $errorCode user]} { ns_log Error $errorInfo } set error "

Error: [ns_quotehtml $result]

" } elseif {[string length $record] > 0} { if {[string equal $q(format) plain]} { ns_return 200 text/plain "$record\n" ns_adp_return } else { set record "

Your $type Record

[ns_quotehtml $record]
" } } } %> tinydns Record Maker

tinydns Record Maker

by Rob Mayoff
<%= $error %> <%= $record %>

Create a tinydns RP, SRV, or TXT Record

<%="
"%>
<%=[html::radio format html html]%> Return an HTML Page (for interactive use) <%=[html::radio format plain]%> Return just the record (for programmatic use)

RP (Responsible Person)

The RP record is described in RFC 1183.

Domain: <%=[html::text rpdomain "" $q(rpdomain)]%>
Mailbox: <%=[html::text rpmbox "" $q(rpmbox)]%>
(For "Mailbox", change the "@" to a dot in your email address. This form will not do that automatically.)
TXT domain: <%=[html::text rptxt "" $q(rptxt)]%>
(You can leave "TXT domain" empty if you don't have some domain with TXT records that should be associated with the RP of this domain.)

SRV (Service Location)

The SRV record is described in RFC 2052.

In case you want to hand-hack a generated SRV record later, here is the format of the payload:

priority weight  port    target
MSB LSB  MSB LSB MSB LSB LABEL-SEQUENCE

LABEL-SEQUENCE is in the format of QNAME described in RFC 1035, section 4.1.2.

Service: <%=[html::text srvservice "" $q(srvservice)]%> (Example: http.tcp.www.dqd.com)
Priority: <%=[html::text srvpriority "" $q(srvpriority)]%>
Weight: <%=[html::text srvweight "" $q(srvweight)]%>
Port: <%=[html::text srvport "" $q(srvport)]%> (Example: 80)
Target: <%=[html::text srvtarget "" $q(srvtarget)]%> (Example: mug.dqd.com)

TXT (Text)

tinydns-data has built-in support for TXT records, but you have to escape colons, backslashes, and newlines. This form does that for you.

Domain: <%=[html::text txtdomain "" $q(txtdomain)]%> (Example: info.example.com)
Text:

(Example: "See http://example.com/info")

Someday I may add the ability to create other record types. Mail me your requests.

Non-ASCII Characters

This software will attempt to convert non-ASCII characters into UTF-8 in the output records. However, various problems in Web protocols make this conversion unreliable. I do my best, but you are warned that it might not work. Note that non-ASCII characters are not currently allowed in DNS on the Internet.

mayoff@dqd.com