ldns(3)

πŸ“¦
version 1.9.2 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 (NULL for /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 (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. πŸ’–πŸŽ€πŸŒΈ