HomeFreeBSD

Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf

Description

Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf

This /etc/resolv.conf:

  1. x
  2. nameserver 8.8.8.8

Still configured 8.8.8.8 as nameserver, because the comment detection in ldns_resolver_new_frm_fp_l() didn't anticipate empty lines before the comment.
This fix removed all comment handling from ldns_resolver_new_frm_fp_l(). Instead a new function is introduced ldns_fget_token_l_resolv_conf() that skips comments that start with '#' and ';'. The old ldns_fget_token_l() (that is used for zonefiles too) still accepts only ';' for comments.

Details