Skip to content

Commit

Permalink
Merge branch 'devel' into new/OTHER_types
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed Jan 15, 2021
2 parents e5a9579 + 136006b commit d065328
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 156 deletions.
14 changes: 5 additions & 9 deletions api_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ function resolveHostname($clientip, $printIP)
$data = array_merge($data, array('network' => $network));
}

$qtypes = ["A", "AAAA", "ANY", "SRV", "SOA", "PTR", "TXT", "NAPTR", "MX", "DS", "RRSIG", "DNSKEY", "NS", "OTHER", "SVCB", "HTTPS"];
if (isset($_GET['getAllQueries']) && $auth)
{
$allQueries = array();
Expand Down Expand Up @@ -121,17 +120,14 @@ function resolveHostname($clientip, $printIP)
if(!is_bool($results))
while ($row = $results->fetchArray())
{
// Try to resolve host name of this client
$c = resolveHostname($row[3],false);

// Convert query type ID to name
// Names taken from FTL's query type names
$qtype = intval($row[1]);
if($qtype > 0 && $qtype <= count($qtypes))
$query_type = $qtypes[$qtype-1];
else
$query_type = "TYPE".(intval($row[1]) - 100);

// array: time type domain client status upstream destination
$query_type = getQueryTypeStr($row[1]);

// Insert into array
// array: time type domain client status upstream destination
$allQueries[] = [$row[0], $query_type, utf8_encode(str_replace("~"," ",$row[2])), utf8_encode($c), $row[4], utf8_encode($row[5])];
}
}
Expand Down
2 changes: 1 addition & 1 deletion cname_records.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
<div class="box-footer clearfix">
<strong>Note:</strong>
<p>The target of a <code>CNAME</code> must be a domain that the Pi-hole already has in its cache or is authoritative for. This is an universal limitation of <code>CNAME</code> records.</p>
<p>The target of a <code>CNAME</code> must be a domain that the Pi-hole already has in its cache or is authoritative for. This is a universal limitation of <code>CNAME</code> records.</p>
<p>The reason for this is that Pi-hole will not send additional queries upstream when serving <code>CNAME</code> replies. As consequence, if you set a target that isn't already known, the reply to the client may be incomplete. Pi-hole just returns the information it knows at the time of the query. This results in certain limitations for <code>CNAME</code> targets,
for instance, only <i>active</i> DHCP leases work as targets - mere DHCP <i>leases</i> aren't sufficient as they aren't (yet) valid DNS records.</p>
<p>Additionally, you can't <code>CNAME</code> external domains (<code>bing.com</code> to <code>google.com</code>) successfully as this could result in invalid SSL certificate errors when the target server does not serve content for the requested domain.</p>
Expand Down
Loading

0 comments on commit d065328

Please sign in to comment.