15

I have a bind DNS server and i'd like to catch all requests for subdomains that don't have a specific record and point them to a specific IP.

This would be like *.domain.tld > 1.1.1.1 and www.domain.tld > 2.2.2.2

Arcath
  • 513
  • 4
  • 13
  • 27

1 Answers1

23

Just adding the wildcard entry should work.

www.domain.tld. 14400 IN A 2.2.2.2
*.domain.tld. 14400 IN A 1.1.1.1
Hyppy
  • 15,608
  • 1
  • 38
  • 59
  • 1
    Does the wildcard also include the main domain? – ram4nd Feb 20 '19 at 09:19
  • 1
    @ram4nd No, it only covers the subdomains. Ref https://serverfault.com/questions/473284/wildcard-dns-redirect-to-root-as-well – Tran Triet Sep 11 '19 at 08:02
  • Just to add that you can use a `CNAME` record to the canonical name instead to the ip e.g `@ -> 1.1.1.1` `* -> CNAME domain.tld.` and `www -> 2.2.2.2` – Rodrigo Jul 22 '23 at 02:35