As of now, FILESS.IO only supports DNS queries over IPv4. DNS queries using IPv6 (AAAA records) are not yet supported and may fail.
To avoid connectivity issues, ensure that your system or application prioritizes IPv4 resolution over IPv6.
🔧 Kubernetes Example (CoreDNS)
If your application is running inside a Kubernetes cluster, you can force CoreDNS to rewrite IPv6 (AAAA) requests to IPv4 (A) by editing the CoreDNS config:
kubectl edit configmap coredns -n kube-system
Then, add the following line to the Corefile under the .:53 block:
.:53 {
+ rewrite stop type AAAA A
errors
health
ready
# ...
}
This ensures CoreDNS responds using IPv4 only.
💻 Application-Level Fixes
If you're not using Kubernetes, or want to enforce IPv4 at the application level, here are examples for common runtimes:
Node.js
Force DNS resolution to IPv4 by setting the family option to 4 in dns.lookup():
const dns = require('dns');
dns.lookup('your-db.filess.io', { family: 4 }, (err, address, family) => {
if (err) throw err;
console.log(`IPv4 address: ${address}`);
});
If using a library like mysql2 or axios, you can wrap DNS manually or force IPv4 via system DNS settings.
PHP
Use STREAM_CLIENT_CONNECT with AF_INET to force IPv4 resolution when creating a socket:
$context = stream_context_create([
'socket' => [
'bindto' => '0.0.0.0:0', // Force IPv4
],
]);
$fp = stream_socket_client(
'tcp://your-db.filess.io:3306',
$errno,
$errstr,
30,
STREAM_CLIENT_CONNECT,
$context
);
Alternatively, modify /etc/gai.conf on Linux to prefer IPv4 system-wide by uncommenting:
precedence ::ffff:0:0/96 100