DNS Automation Library Programming FAQ
1. I get an error 'user connections cannot be used for local connections'. What does that mean?
If you are using the library on the same machine as the DNS server (localhost) itself you will receive this error
if you are supplying username/password. You should supply blank username and password in this situation.
You should only supply crudentials when connecting to a different box than the library is running on.
2. Do I need to install the WMI DNS provider on Win2003?
No, you don't need to install the provider since it is included as standard in Windows 2003. However, you must install it on Windows2000
3. I'm not sure my WMI is working correctly. What tests can I try?
The following tests are good for checking that
- the WMI provider is registered correctly
- the DNS server is up and running
- connectivity to the dns server
1. Navigate to the c:\winnt\system32\wbem folder
2. Double-click on wbemtest.exe
3. Press Connect
4. The the Server\Namespace box, enter \\[server]\root\microsoftdns e.g. \\localhost\root\microsoftdns
5. In the credentials area do not specify username/password if you are connecting to the local server or enter the username and password if the dns server is remote
6. Press Login
If connection to the DNS server namespace in WMI is successful then the DNS provider has been registered successfully
7. Press Query
8. Enter "select * from microsoftdns_zone"" and press Apply
If successful, you should get a list of zone entries back from DNS server. This would prove there are not security issue and the DNS server is running
4. I have a firewall between the DNS server and the machine running the libary. Which port should I open up?
WMI requires the RCP port (135) to be opened.
5. I'm getting an 'invalid namespace' errors when calling functions in the library. What is wrong?
You have not installed the WMI DNS provider for Windows2000. You should follow these steps:
1. Copy 'dnsprov.mof' and 'dnsprov.dll' files from the DNS server folder in the installation folder to c:\winnt\system32\wbem
2. Navigate to the c:\winnt\system32\wbem folder in command prompt
3. Type 'mofcomp dnsprov.mof'
4. Type 'regsvr32 dnsprov.dll'
6. When I create a secondary zone I get an error 'invalid parameter'? What does that mean?
It's possible that you may be using the NT2000 version of the library to talk to the Win2003 server rather than the Win2003 version. There is a WMI syntax change between Win2000 and Win2003 (thanks to Microsoft) and they are incompatible with each other when creating secondary zones.
Make sure that you have copied and register the RVSWDNS.dll from the \Windows2003\ActiveXDll folder in the install folder and not the \Window2000NT4\ActiveXDll folder (filenames are identical).
Also ensure that you are calling the CreateZone method with the correct parameters too:
CreateZone "mydomain.it", "ip_address_of_SECONDARY_server", RVSWDNS.Secondary, "username", "password", "domain", "ip_address_of_PRIMARY_server"
Parameter1: your zone to create eg mydomain.com
Parameter2: the ip address or dns name of the secondary dns server
Parameter3: secondary zone enum
Parameter4: username of admin user
Parameter5: password of admin user
Paremeter6: AD domain of admin user (blank if in same domain)
Parameter7: the ip address or dns name of the primary server
The Parameter7 is very important!
7. Is it possible to edit SOA records with the library?
Yes, since version 1.2 was released, you can edit SOA records.
8. Is it possible to enumerate resources in side sub-domains in a zone?
Yes, since version 1.2 was released, you can edit SOA records.
9. I've got Windows2000 and have called CreateZone method but get a 'not found' error message. What this?
The WMI installation is corrupt. Please un-register the library, the WMI provider and re-install the WMI provider and re-register the library
10. I'm getting a 'RPC server is unavailable' error message. What can I do?
This error would suggest one of the following things might be the cause:
1) an invalid server name is given in the Server parameter i.e. doesn't resolve
2) the specified server is down or unreachable due to a firewall
3) the RPC/WMI service on the server has hung - try a reboot!
4) the DNS service is not started
If you have a firewall between the too make sure that the RPC port is opened otherwise the firewall will block the WMI packets! (This happens to me here). ie this error is a connectivity issue
You could always try the infamous Windows reboot if it was working but is not now!
11. I'm getting a "generic failure" message when attempting to change the zone type from secondary to primary. What could cause this?
In most circumstances this is caused by the secondary zone not being loaded from the master server. You should make sure that in DNS Adminstrator the secondary zone is loaded with information from the master to prevent this error message.