This is an example written in PHP allowing users to manage DNS Manager clients, DNS Zones and DNS Records. Download.
This demonstrative code SHOULD NOT be used in production. It is designed to show how a client application can interact with the DNS Manager SystemAPI. From this perspective, validations and error-checks aiming to demonstrate the most common mistakes are minimal and can be done easily.
How To Install It
In order to be able to use the SystemAPI PHP example, your system must be compliant with the requirements below:
- Your system needs to have PHP 5.1.2 or any subsequent version installed.
- PHP must be compiled using the --enable-soap configuration option.
- The SystemAPI PHP example requires the PHP extension libxml - Version 2.5.4 or any subsequent version.
- Download the archive, extract the files and copy them to a directory that can be accessed over the Web.
- In order to use the tool, you must configure it. To do so, you must open the file config.php in the <PATH_TO_SYSTEMAPI_PHP_TOOL>/config.php and change the following settings:
- Set the $dnsmanager_ip variable to the IP or hostname of your DNS Manager server.
- Set the $dnsmanager_username to the username of the DNS Manager account you want to use.
- Set the $dnsmanager_password to the password of the DNS Manager account you want to use.
- Set the $dnsmanager_port to the port of the DNS Manager server.
- Set the $dnsmanager_version to the version of the DNS Manager schema files.
- Set the $request_typeto the request type you want to make:
- If you want to add a client account, you must set the variable $request_type = "client"
- If you want to add a DNS Zone, you must set the variable $request_type = "dnszone" and also set the $client_id to the ID of the client that owns the DNS Zone.
- In order to add a DNS Record, you must set the variable $request_type = "dnsrecord". It is also required that you set the $dnszone_name to the name of the DNS Zone that will contain the DNS Record.
How To Use It
To access the interface, simply visit https://<IP>/<PATH_TO_SYSTEMAPI_TOOL>/index.php.
Please note that you can't access the application unless you set it up before. Otherwise, you will get a warning message with the issues you need to fix, just as shown below:
- If Current PHP version > 5.1.2 setup is not validated, you should check your PHP installation.
- If PHP is configured with --enable-soap setup is not validated, you should make sure the PHP is compiled using the --enable-soap option.
- If DNSManager SystemAPI is reachable setup is not validated, then you should check the configuration file and make sure you have correctly set the server or connection parameters.
Once the configuration process is complete, you can access the interface and use it to add clients, DNS Zones and DNS Records.
Adding a Client
Using this section of the application you can add client accounts to DNS Manager. The following information can be set using the form:
The company name of the user
The contact name of the user
Username for the new account
Password for the new account
Phone number of the new account
Fax number of the new account
Email of the new account
Address of the new account
City for the new account
Postal/ZIP code for the new account
Select a country from the list of countries
Select a state or province
More notes about the account
Adding a DNS Zone
By using this section of the application, you can add DNS Zones to the DNS Manager server. The following information can be set using the form:
DNS Zone Name
The name of the DNS Zone
DNS Zone Type
The type of the DNS Zone. Can be either master, or slave.
- You can set the $template_id parameter in the configuration file to create the DNS Zone from a template
- You can set the $template_ip parameter in the configuration file to add a template IP for the DNS Zone
Adding a DNS Record
By using this section of the application, you can add DNS Records to the DNS Manager server. The following information can be set using the form:
DNS Record Name
The type of the DNS Record
The value of the record.
Check if you have a primary record.
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.