2

We're running a Windows Server 2008 AD serving as DHCP and DNS for more than 300 PC.

When a PC desktop with the name "harry" connects to the network, the DHCP server gives it a lease, and adds appropriate A & PTR records via Windows DHCP+DNS.

This works fine; harry.my.domain points to 192.168.1.3, the client knows that its name is harry.my.domain, 192.168.1.3 points back to harry.my.domain, and all that is great.

Now I want every PC to have a wildcard : e.g *.harry.my.domain to resolve to 192.168.1.3, but I don't want to manually prepare a wildcard record for each of the 300 DHCP PC in the AD.

Is there a way to do this?

Thanks!

PS: my need is extremely close to this other question (but with unix, isc-dhcpd and bind, which I am much more familiar with...) so I took it as a template: Automatic subdomain wildcard for DHCP-DDNS additions?

BorisHajduk
  • 259
  • 2
  • 7

1 Answers1

0

In a cmd.exe on the DNS server :

for /F %%a in (host-list.txt) do 
  dnscmd /recordadd mydomain.tld *.%%a cname %%a.mydomain.tld.

Note: host-list.txt should contain every hostname on your network. One way to create host-list.txt is to edit the result of the following command :

dnscmd /enumrecords mydomain.tld @ /type A

It's not perfect though, as it creates lots of new subzones in the DNS.

BorisHajduk
  • 259
  • 2
  • 7