DNS does not resolve FQDN

Latest response

OCP 4.5.7
If a pod uses FQDN resolve fails.
If the same pod just uses hostname it works.
If I change "options ndots:5" to "ndots:1" in /etc/resolv.conf in the pod, the FQDN is resolved.
The hostname/FQDN is another pod running in same namespace.
Example:
oc exec -it podname -- bash
$ curl -X GET "https://username:password@couchdb.cpd.svc.cluster.local"
this fails, while
$ curl -X GET "https://username:password@couchdb"
works

Responses

Hi Claus,

From what we can see, you are trying to resolve hostname "couchdb.cpd.svc.cluser.local", which has FOUR dots in its name.

On-line manuals might give you a solution:

 ndots:n
              sets a threshold for the number of dots which must appear in a name given to res_query(3) (see resolver(3)) 
              before an initial absolute query will be made.  The default for n is 1, meaning that if there are any dots in a name, the 
              name will  be tried first as an absolute name before any search list elements are appended to it.  The value for this 
              option is silently capped to 15.

Regards,

Dusan Baljevic (amateur radio VK2COT)