Skip to content

Wildcard DNS Support for DNSEndpoint Resources #106

Description

@angelbarrera92

Problem Description

The CoreDNS CRD plugin currently does not support wildcard DNS entries. When creating a DNSEndpoint with a wildcard pattern like *.example.com, queries for subdomains such as whatever.example.com fail to resolve.

Current Behavior

  • DNSEndpoint with dnsName: "*.example.com" is created
  • Query for whatever.example.com returns no results (NXDOMAIN or empty response)
  • Only exact hostname matches work

Expected Behavior

  • DNSEndpoint with dnsName: "*.example.com" should match single-level subdomains
  • Query for whatever.example.com should resolve to the targets defined in the wildcard entry
  • Follow standard DNS wildcard behavior:
    • *.example.com should match test.example.com
    • *.example.com should NOT match example.com (apex domain) ✗
    • *.example.com should NOT match sub.test.example.com (multi-level) ✗
  • Exact matches should take precedence over wildcard matches

Example Use Case

apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
  name: wildcard-apps
  labels:
    k8gb.absa.oss/dnstype: local
spec:
  endpoints:
  - dnsName: "*.apps.example.com"
    recordType: A
    targets:
    - 192.168.1.100
    - 192.168.1.101

With this configuration:

  • app1.apps.example.com → should resolve to 192.168.1.100, 192.168.1.101
  • app2.apps.example.com → should resolve to 192.168.1.100, 192.168.1.101
  • apps.example.com → should NOT match the wildcard

Additional Context

This is a standard DNS feature (RFC 4592) and would greatly simplify DNS management for dynamic or multi-tenant environments where many subdomains need to resolve to the same targets.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions