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 example.com { 
             1.1.1.1 server1.example.com 
             1.1.1.2 server2.example.com 
             fallthrough 
        }

server1.example.com 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?