ldns(3) Library Functions Manual ldns(3)

# [NAME](#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

# [SYNOPSIS](#SYNOPSIS)

#include &lt;stdint.h&gt;  
#include &lt;stdbool.h&gt;

#include &lt;ldns/ldns.h&gt;

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);

# [DESCRIPTION](#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

*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

*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

# [AUTHOR](#AUTHOR)

The ldns team at NLnet Labs.

# [REPORTING BUGS](#REPORTING_BUGS)

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

# [COPYRIGHT](#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.

# [SEE ALSO](#SEE_ALSO)

*ldns\_rr\_list*, *ldns\_rr*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034** and **RFC4035**.

# [REMARKS](#REMARKS)

This manpage was automatically generated from the ldns source code.

30 May 2006

---

Document: ldns_get_rr_list_hosts_frm_file(3) from ldns 1.9.2-r2 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
