How to add the servicename of dns pod in dnsconfig

Hello- I want to deploy a new dns nameserver pod and i want to use that as nameserver in other pod. I found below config but in the nameserver we have to add IP address of the dns pod which changes when restarts. So is there any way to add the servicename of dns pod in dnsconfig?

  dnsConfig:
    nameservers:
      - 1.2.3.4```
Expected something like or Is any other options i can try out?
```  dnsPolicy: "None"
  dnsConfig:
    nameservers:
      - dnspodServiceName```

You can create the service, then use the clusterIP for the nameserver. you can’t put in a dnsServiceName, because the value is injected literally into the /etc/resolv.conf. and the resolv.conf requires an ip, not a dns name.

Are you looking for fowarder https://coredns.io/manual/toc/#forwarding-domains-to-different-upstreams

You also might want to consider whether you should really be doing this or if you can just use the existing features to add custom dns entries into core dns.

Thanks for the reply. Other way i am thinking is below. I think it will work?

      dnsConfig:
        searches:
          - <dnsServicename>.svc.cluster.local```

Not exactly. I don’t want to use core-dns i want to use my own dns which was deployed as another pod

Like replace coredns?

Basically two dns in one cluster

That won’t work for the reason i explained above