Update an DNS Override
Update an DNS override which is in the user’s scope.
Permissions required: User must have WAS module enabled. User account must have these permissions:
Access Permission: API Access
Input ParametersInput Parameters
Click here for available operators
|
Parameter |
Mandatory /Optional |
Data Type |
Description |
|---|---|---|---|
| name |
Optional |
integer |
(text) The name given to the DNS override. |
| DnsMapping (keyword) |
Optional |
text |
Use to configure the DNS override setting through API. You need to specify the hostname or FQDN and the corresponding IP address to be preferred for scanning. Example: <set> |
|
When you update an DNS override, ensure: Name: In case of name update, the updated name should be unique. Id is required. At lease one of the following should be present other than id: Name, owner, tags, comments, mappings Tags: The <set> and <Add>/ <Removed> tags are mutually exclusive. Either use <set> or <Add> and <Removed>. Mappings: The <set> and <Add>/ <Removed> tags are mutually exclusive. Either use <set> or <Add> and <Removed>. |
Sample - Update DNS Override (POST)Sample - Update DNS Override (POST)
API request:
curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST"--data-binary@-
"<qualys_base_url>/qps/rest/3.0/update/was/dnsoverride/" < file.xml
Note: "file.xml" contains the request POST data.
Request POST data:
<ServiceRequest>
<data>
<DnsOverride>
<name>
<![CDATA[DNS Record]]>
</name>
<mappings>
<set>
<DnsMapping>
<hostName>host_1</hostName>
<ipAddress>2.3.4.5</ipAddress>
</DnsMapping>
<DnsMapping>
<hostName>host_2</hostName>
<ipAddress>1.2.3.4</ipAddress>
</DnsMapping>
</set>
</mappings>
<tags>
<set>
<Tag>
<id>8993614</id>
</Tag>
<Tag>
<id>8876615</id>
</Tag>
</set>
</tags>
</DnsOverride>
</data>
</ServiceRequest>
XML response:
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/was/dnsoverride.xsd">
<responseCode>SUCCESS</responseCode>
<count>1</count>
<data>
<DnsOverride>
<id>57020</id>
</DnsOverride>
</data>
</ServiceResponse>
Sample - Update DNS Override (using add and remove tag)Sample - Update DNS Override (using add and remove tag)
API request:
curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST"--data-binary@-
"<qualys_base_url>/qps/rest/3.0/update/was/dnsoverride/" < file.xml
Note: "file.xml" contains the request POST data.
Request POST data:
<ServiceRequest>
<data>
<DnsOverride>
<name>
<![CDATA[DNS Record]]>
</name>
<mappings>
<remove>
<DnsMapping>
<hostName>host_1</hostName>
<ipAddress>1.2.3.4</ipAddress>
</DnsMapping>
<DnsMapping>
<hostName>host_2</hostName>
<ipAddress>1.2.3.6</ipAddress>
</DnsMapping>
</remove>
<add>
<DnsMapping>
<hostName>host_3</hostName>
<ipAddress>1.2.3.5</ipAddress>
</DnsMapping>
<DnsMapping>
<hostName>host_4</hostName>
<ipAddress>1.2.3.7</ipAddress>
</DnsMapping>
</add>
</mappings>
<tags>
<set>
<Tag>
<id>8993614</id>
</Tag>
<Tag>
<id>8876615</id>
</Tag>
</set>
</tags>
</DnsOverride>
</data>
</ServiceRequest>
XML response:
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/was/dnsoverride.xsd">
<responseCode>SUCCESS</responseCode>
<count>1</count>
<data>
<DnsOverride>
<id>57020</id>
</DnsOverride>
</data>
</ServiceResponse>