ldns(3)
π ldns(3) β the hosts-file parser era π
okay bestie, so this is a page from the ldns library manual (yes, ldns(3), library functions manual energy), and we're talking about three little functions that go rummaging through your /etc/hosts file and pull out all the hosts they can find. it's giving "who's home" but for DNS records. π β¨
πΈ NAME πΈ
ldns_get_rr_list_hosts_frm_file, ldns_get_rr_list_hosts_frm_fp, ldns_get_rr_list_hosts_frm_fp_l β parse /etc/hosts file
like. the whole squad is here. three functions, one job. π
β¨ SYNOPSIS β¨
#include <stdint.h>
#include <stdbool.h>
#include <ldns/ldns.h>
ldns_rr_list* ldns_get_rr_list_hosts_frm_file(char *filename);
ldns_rr_list* ldns_get_rr_list_hosts_frm_fp(FILE *fp);
ldns_rr_list* ldns_get_rr_list_hosts_frm_fp_l(FILE *fp, int *line_nr);
no cap, that's the whole signature situation. π
π¦ DESCRIPTION π¦
ldns_get_rr_list_hosts_frm_file() β wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there
- filename: the filename to use (
NULLfor/etc/hosts) - Returns
ldns_rr_list *with the names
bestie, if you pass NULL it literally just defaults to /etc/hosts. iconic behavior honestly. π
ldns_get_rr_list_hosts_frm_fp() β wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there
- fp: the file pointer to use
- Returns
ldns_rr_list *with the names
same vibe, but you're handing it a file pointer you already opened. main character move. π₯
ldns_get_rr_list_hosts_frm_fp_l() β wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there
- fp: the file pointer to use
- line_nr: pointer to an integer containing the current line number (for debugging purposes)
- Returns
ldns_rr_list *with the names
the _l at the end is for line numbers, and it's for debugging purposes β that's the whole reason she exists. she's the one who keeps receipts. ππ
π AUTHOR π
The ldns team at NLnet Labs.
periodt. that's the team. π«Ά
π REPORTING BUGS π
Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues
like, fr fr, if something's cursed, tell them. they wanna know. π
π COPYRIGHT π
Copyright (c) 2004 - 2006 NLnet Labs.
Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
β οΈ okay so the all-caps is doing a lot of yelling but it's serious β NO warranty. none. not even the "well maybe it works for selling it" kind, and not even the "works for one specific purpose" kind. if it breaks, that's a you problem. π
π SEE ALSO π
ldns_rr_list, ldns_rr. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035.
go read the lore, iykyk. πβ¨
β REMARKS β
This manpage was automatically generated from the ldns source code.
yeah she's machine-made. still cute though. π€π
that's the whole page bestie, every flag, every return type, every reference β nothing skipped, nothing invented. π¦
sending you off with the classic: this was ldns(3) from 30 May 2006 β old enough to have its own vintage aesthetic, still parsing hosts files like a champ. πππΈ
π¦ where this page comes from
- alpine 3.22: ldns-doc 1.8.4-r0 Β· BSD-3-Clause
- alpine 3.23: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- alpine 3.24: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- arch rolling: ldns 1.9.2-1 Β· custom:BSD
- debian trixie: libldns-dev 1.8.4-2+b1
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- nixos 26.05: ldns 1.9.2
- nixpkgs unstable: ldns 1.9.2
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- ubuntu questing: libldns-dev 1.8.4-2build1
- ubuntu resolute: libldns-dev 1.8.4-2build3
- ubuntu stonking: libldns-dev 1.9.2-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms