Create DNS Override

[POST] /qps/rest/3.0/create/was/dnsoverride

Create a new DNS Override.

Permissions required - User must have WAS module enabled. User account must have these permissions: Access Permission “API Access”.

Input ParametersInput Parameters

The element “name” (text) and "mappings" is required, where “name” is name of the DNS override.

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

name

Optional

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>
   <DnsMapping>
      <hostName>test</hostName>
       <ipAddress>2.3.4.5</ipAddress>
   </DnsMapping>
</set>

     

When you create a new DNS override, ensure:

-Name (Required): Name should be unique.

-Tags: The tag id should be valid and in scope of current user. Use only <Set> tag.

-Mappings (Required): Each mapping must have hostName and IpAddress in valid format. Use only <Set> tag.

-Comments: Only <Set> with 1 comment is allowed with maximum length 2048 characters.

Sample - Create DNS Override (POST)Sample - Create 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/create/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>f      
    

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>57220</id>
            <name>
                <![CDATA[DNS Record]]>
            </name>
            ...
            
            <mappings>
                <count>2</count>
                <list>
                    <DnsMapping>
                        <hostName>host_1</hostName>
                        <ipAddress>2.3.4.5</ipAddress>
                    </DnsMapping>
                    <DnsMapping>
                        <hostName>host_2</hostName>
                        <ipAddress>1.2.3.4</ipAddress>
                    </DnsMapping>
                </list>
            </mappings>
        </DnsOverride>
    </data>
</ServiceResponse>