This guide provides a structured solution to resolve java.net.UnknownHostException: connectors.airbyte.com, which occurs when Airbyte fails to resolve DNS for external services. The primary goal is to ensure proper DNS resolution by configuring CoreDNS to use reliable external DNS servers.
abctl is a wrapper tool for managing Airbyte deployments but internally uses Kubernetes. To diagnose and fix DNS issues effectively, we need direct access to Kubernetes commands (kubectl).
-
Identify the kubeconfig file used by
abctl:abctl local deploymentsNote the
Kubeconfigfile path, e.g.,/home/ubuntu/.airbyte/abctl/abctl.kubeconfig. -
Set the
KUBECONFIGenvironment variable so thatkubectluses the same configuration:export KUBECONFIG=/home/ubuntu/.airbyte/abctl/abctl.kubeconfig -
Confirm the Kubernetes context is correct:
kubectl config current-context
-
Test access by listing pods in the Airbyte namespace:
kubectl get pods -n airbyte-abctl
This ensures we are ready to use Kubernetes tools to address the DNS resolution issue.
By default, CoreDNS forwards DNS requests to /etc/resolv.conf, which may rely on the internal DNS of the environment (e.g., a private cloud or restricted network). If this DNS setup fails to resolve external domains like connectors.airbyte.com, updating CoreDNS to use a reliable public DNS server (e.g., Google DNS) ensures proper resolution.
-
Edit the CoreDNS ConfigMap:
kubectl edit configmap coredns -n kube-system
-
Replace this configuration:
forward . /etc/resolv.conf { max_concurrent 1000 }
With this:
forward . 8.8.8.8 8.8.4.4 { max_concurrent 1000 }
Explanation: This change redirects DNS queries to Google Public DNS (
8.8.8.8and8.8.4.4), which are highly reliable for resolving external domains. -
Save and exit the editor.
-
Restart CoreDNS to apply the changes:
kubectl rollout restart deployment coredns -n kube-system
This step ensures that any DNS query made by pods in your Kubernetes cluster is forwarded to reliable DNS servers.
Restarting the CoreDNS pods ensures that the updated configuration is active. Restarting the Airbyte Server API pod ensures it picks up the new DNS settings and retries DNS queries for external domains.
-
Confirm CoreDNS pods are running after the restart:
kubectl get pods -n kube-system
-
Restart the Airbyte Server API pod:
kubectl delete pod <server-pod-name> -n airbyte-abctl
Replace
<server-pod-name>with the name of the Airbyte Server API pod, which you can find using:kubectl get pods -n airbyte-abctl
-
Verify that Airbyte now resolves
connectors.airbyte.comcorrectly. Check the pod logs for confirmation:kubectl logs <server-pod-name> -n airbyte-abctl
You should no longer see the
UnknownHostExceptionerror.
After completing these steps, the Airbyte Server API should be able to resolve connectors.airbyte.com without issues, allowing it to fetch connector documentation and related resources. This fix ensures reliable DNS resolution across your Kubernetes cluster.