Skip to content

K8S DNSConfig not apply to the pod #612

Open

Description

@mysiki

Describe the bug
When we deploy a windows container with DNSConfig parameter, this parameter is not apply to the container.

To Reproduce

  • Deploy custom coreDNS pod
  • Deploy Pod with DNSconfig which point to this coreDNS service

Expected behavior
POD DNS should be setup with the information which come from DNSConfig

Configuration:

  • Edition: Windows Server]
  • Base Image being used: tested on Windows Server Core 2022 and Windows server nano 2022
  • Container engine: K8S - ctr
  • Container Engine version K8S (on EKS) 1.30

Additional context

The same dnsConfig setting work normally on Linux pod.

Pod manifest

---
apiVersion: v1
kind: Pod
metadata:
  name: powershell-debug
spec:
  containers:
  - name: powershell
    # image: mcr.microsoft.com/powershell:lts-7.2-nanoserver-ltsc2022
    image: mcr.microsoft.com/windows/servercore:ltsc2022
    # command: ["pwsh"]
    command: ["powershell.exe"]
    args: ["-c", "ping", "-t", "localhost"]
  dnsConfig:
    nameservers:
    - 172.20.159.24
    options:
    - name: ndots
      value: "5"
    searches:
    - svc.cluster.local
    - cluster.local
  dnsPolicy: None
  nodeSelector:
    kubernetes.io/os: windows
    kubernetes.io/arch: amd64
  tolerations:
    - effect: NoSchedule
      key: os
      operator: Equal
      value: windows
    - effect: NoExecute
      key: os
      operator: Equal
      value: windows

From the pod :

PS C:\> Get-DnsClientServerAddress

InterfaceAlias               Interface Address ServerAddresses
                             Index     Family
--------------               --------- ------- ---------------
vEthernet (cid-b20de771-e...        39 IPv4    {172.20.0.10}    <== Default corsDNS, not the custom one define into the config
vEthernet (cid-b20de771-e...        39 IPv6    {}
Loopback Pseudo-Interface 6         38 IPv4    {}
Loopback Pseudo-Interface 6         38 IPv6    {}

Resolve-DnsName -name svcname.svc.cluster.local
Resolve-DnsName : svcname.svc.cluster.local : DNS name does not exist
At line:1 char:1
+ Resolve-DnsName -name svcname.svc.c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (svcname...c.cluster.local:String) [Resolve-DnsName], Win32Exception
    + FullyQualifiedErrorId : DNS_ERROR_RCODE_NAME_ERROR,Microsoft.DnsClient.Commands.ResolveDnsName
Resolve-DnsName -name svcname.svc.cluster.local -Server 172.20.159.24

Name                                           Type   TTL   Section    IPAddress
----                                           ----   ---   -------    ---------
svcname.svc. A      5     Answer     172.20.111.200
cluster.local

Activity

  1. added
    bugSomething isn't working
    triageNew and needs attention
    on Sep 6, 2025
  2. github-actions commented on Sep 6, 2025

    @github-actions

    Thank you for creating an Issue. Please note that GitHub is not an official channel for Microsoft support requests. To create an official support request, please open a ticket here. Microsoft and the GitHub Community strive to provide a best effort in answering questions and supporting Issues on GitHub.

  3. microsoft-github-policy-service commented on Oct 7, 2025

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  4. microsoft-github-policy-service commented on Nov 6, 2025

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  5. microsoft-github-policy-service commented on Dec 6, 2025

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  6. microsoft-github-policy-service commented on Jan 8, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  7. microsoft-github-policy-service commented on Feb 10, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  8. microsoft-github-policy-service commented on Mar 16, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  9. microsoft-github-policy-service commented on Apr 15, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  10. microsoft-github-policy-service commented on May 15, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  11. microsoft-github-policy-service commented on Jun 15, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  12. microsoft-github-policy-service commented on Jul 15, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  13. microsoft-github-policy-service commented on Aug 19, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  14. microsoft-github-policy-service commented on Sep 18, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  15. microsoft-github-policy-service commented on Oct 19, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew and needs attention

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions