Re: unescaped double quotes in TXT record

Daryl Tester <[email protected]> Tue, 25 May 2010 22:42:24 +0930
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
Hugo Monteiro wrote:

>> (And yippee, another protocol overloading the TXT record).

> Looks like it, but the question now is: Is there any way to solve 
> this?... probably a well crafted generic record can do it..

Heck yeah.  If you don't want to figure it out by hand, your dnsq of the
bind server gave you the answer you need -

>>> $ dnsq txt xerox_phaser_6130n._ipp._tcp.dev.hmonteiro.net 192.168.56.103
>>> 16 xerox_phaser_6130n._ipp._tcp.dev.hmonteiro.net:
>>> 212 bytes, 1+1+1+1 records, response, authoritative, weird ra, noerror
>>> query: 16 xerox_phaser_6130n._ipp._tcp.dev.hmonteiro.net
>>> answer: xerox_phaser_6130n._ipp._tcp.dev.hmonteiro.net 604800 16 
>>> \007qtotl=1\026rp=printers/xerox6130n\025ty=Xerox\040Phaser\0406130N\026product=(Phaser\0406130N)\032pdl=application/postscript 

Cut 'n' paste that answer line into your data file (subbing testernet for your
domain) (bear in mind I've mixed up your xerox with your hp - no matter). 

# :fqdn:n:rdata:ttl:timestamp:lo
:hp_4050._ipp._tcp.testernet:16:\007qtotl=1\026rp=printers/xerox6130n\025ty=Xerox Phaser 6130N\026product=(Phaser 6130N)\032pdl=application/postscript:86400

Then dig should give the following answer ...

# dig txt hp_4050._ipp._tcp.testernet @127.0.0.1
(trimmed)
;; ANSWER SECTION:
hp_4050._ipp._tcp.testernet. 86400 IN   TXT     "qtotl=1" "rp=printers/xerox6130n" "ty=Xerox Phaser 6130N" "product=(Phaser 6130N)" "pdl=application/postscript"

Lookie there, more phantom dig-induced quotes.  At least they appear to
be positioned appropriately.  A Perl/Python/Scripting-language-of-choice
script to generate octal key/value lengths should be relatively
straightforward, and left as an exercise to the reader.  :-)

Cheers.


-- 
Regards,
  Daryl Tester

Member of the Amalgamated Australian Association Against Apostrophe Abuse.
(formerly the 6A's - no, wait ...).