No DNS record found for when using a http proxy
You see a failing setup check telling you that "This server has no working internet connection" together with log messages starting with "No DNS record found for ..."
DNS pinning is a security measure against DNS rebinding attacks.
Our DnsPinMiddleware resolves the IP address for a given domain name and runs a couple of checks. For example, if the IP address belongs to a private network or is a loopback address.
To resolve a domain name to an IP address, your server must be able to resolve DNS queries. We are using dns_get_records, which uses the system resolver underneath.
Use the command below to check if your server can resolve DNS queries.
php -r "var_dump(dns_get_record('www.nextcloud.com', DNS_A));"
The expected outcome if DNS resolving works:
Command line code:1:
array(1) {
[0] =>
array(5) {
'host' =>
string(17) "www.nextcloud.com"
'class' =>
string(2) "IN"
'ttl' =>
int(300)
'type' =>
string(1) "A"
'ip' =>
string(15) "213.133.102.119"
}
}
Solution
We recommend that you leave DNS pinning activated!
DNS pinning cannot work if your server cannot resolve DNS queries.
Disable it via occ:
php occ config:system:set --type boolean --value false dns_pinning
Or add the following line to your config.php:
'dns_pinning' => false,
More information
- https://en.wikipedia.org/wiki/DNS_rebinding
- https://github.com/nextcloud/security-advisories/security/advisories/GHSA-8f69-f9jg-4x3v
Subscriber exclusive content
A Nextcloud Enterprise Subscription provides unlimited access to our knowledge base articles and direct access to Nextcloud engineers.