Batch File

You will need to create reverse lookup zones that correspond to all the different subnets that your iOS devices will be associated with, and put 2 PTR records in each zone.

We have written the DOS batch file below that will do the right thing for you.

Example: Let’s say you have a DNS server at 192.168.1.2 and the subnet that you would like to configure is 10.10.0.0 and you name the batch file dns_setup.

dns_setup 192.168.1.2 10.10.0.0

If you run this batch file on the same machine as the DNS Server:

dns_setup .  10.10.0.0

It will create a 0.0.10.10.in-addr.arpa reverse zone, and create 2 PTR records in that zone, b._dns-sd._udp and lb._dns-sd._udp. 

Use this batch file to create your Reverse Lookup Zones and add PTR records.


Batch file:

@echo off

if [%1]==[] (

echo Usage: %0 server subnet 1...subnet n

exit /b

)

set server=%1

shift

:again

if not "%1" == "" (

call :setup %1

shift

GOTO again

)

GOTO :EOF


:setup

for /F "tokens=1,2,3,4 delims=. " %%a in ("%1") do (

dnscmd %server% /ZoneAdd %%d.%%c.%%b.%%a.in-addr.arpa. /DsPrimary

dnscmd %server% /RecordAdd %%d.%%c.%%b.%%a.in-addr.arpa b._dns-sd._udp PTR %%d.%%c.%%b.%%a.dnssd.presto.

dnscmd %server% /RecordAdd %%d.%%c.%%b.%%a.in-addr.arpa lb._dns-sd._udp PTR %%d.%%c.%%b.%%a.dnssd.presto.

)

GOTO :EOF

Feedback and Knowledge Base