coreDNS returning IP instead of hostname for redirect_url

Cluster information:

Kubernetes version: v1.19.7

I have a custom entry for hostnames in coreDNS and this works fine for resolving the hostnames.

hosts custom.hosts { 
        } is a pod that requires an OAuth redirect. When the server constructs the redirect_url for OAuth, it has the IP address, instead of the hostname. Is there a way that coreDNS can return the hostname instead of the IP address?