Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/src/lib/djb-ape/dns/dns_txt.3

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TH dns_txt 3
.SH NAME
dns_txt \- look up TXT records for a FQDN
.SH SYNTAX
.B #include <dns.h>

void \fBdns_txt\fP(&\fIout\fR,&\fIfqdn\fR);
.br
void \fBdns_txt_packet\fP(&\fIout\fR,char *\fIbuf\fR,unsigned int \fIlen\fR);

stralloc \fIout\fR = {0};
.br
stralloc \fIfqdn\fR = {0};

.SH DESCRIPTION
.B dns_txt
looks up TXT records for the fully-qualified domain name in \fIfqdn\fR. It puts
the TXT records into \fIout\fR and returns 0.  If the domain does not
exist in DNS, or has no MX records, \fIout\fR will be empty.

If \fBdns_txt\fR has trouble with the DNS lookup or runs out of
memory, it returns -1, setting \fIerrno\fR appropriately. It may or may
not change \fIout\fR.

.B dns_txt_packet
is a low-level component of \fBdns_txt\fR, designed to support
asynchronous DNS lookups. It reads a DNS packet of length \fIlen\fR from \fIbuf\fR,
extracts the MX records from the answer section of the packet, puts the
results into \fIout\fR, and returns 0 or -1 the same way as \fIdns_txt\fR.

.SH "SEE ALSO"
dns_ip4_qualify(3), dns_ip6_qualify(3), dns_name4(3)

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].