# Data Mapping cfxdm - dm:dns\_ip\_to\_name

**dm:dns\_ip\_to\_name:** It allows to resolve the IP addresses listed in a column to FQDN names into another column.

**dm:dns\_ip\_to\_name:** Syntax

* **from\_cols** (mandatory)**:** Comma-separated list of column names which has IP Address values
* **to\_cols** (mandatory)**:** Comma-separated list of column names to store resolved DNS Names (FQDN).
* **keep\_value** (optional): If it is set to **'yes',** it stores the original value, else it stores the 'null' value. By default, it is set to '**no**'
* **num\_threads** (optional): Number of DNS lookup threads. Must be in the range of 1 to 20, Default is set to 5.

{% hint style="info" %}
This function uses the DNS servers configured on the host os where **RDA** is installed and running for IP Address to DNS or FQDN name resolution.
{% endhint %}

{% hint style="info" %}
It requires an input dataset or a tag that has one or more columns with IP Address values.
{% endhint %}

### Example 1:

Step 1: Create an empty **dm\_dns\_ip\_to\_name\_example\_1** using AIOps studio as shown in the below screenshot

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-Mg7hm8S804NKAQhdaqL%2F-Mg7iV1YRVezolGeEuYM%2FScreen%20Shot%202021-08-02%20at%202.16.46%20PM.png?alt=media\&token=e63d6276-4cb9-4ec6-a358-1c37ff1817d5)

Step 2: Add the following pipeline code/commands into the above-created pipeline as shown in the below screenshot:

You can copy the below code into your pipeline and execute that in your environment.

\
*`###### Pipeline created a dataset with ip_address, process_name and pid (runtime`* \
*`###### information on a windows box.`*\
*`###### Pipeline uses dm:dns_ip_to_name function to resolve name using DNS server using`*\
*`###### RDA macahine where it is installed`*\
\
*`@dm:empty`* \
*`--> @dm:addrow ip_address = '10.95.122.221' & process_name = 'System Process' & pid = 0`*\
*`--> @dm:addrow ip_address = '10.95.122.221' & process_name = 'svchost.exe' & pid = 1020`*\
*`--> @dm:addrow ip_address = '10.95.122.221' & process_name = 'svchost.exe' & pid = 1020`*\
*`--> @dm:addrow ip_address = '10.95.122.221' & process_name = 'silsvc.exe' & pid = 1064`*\
*`--> @dm:addrow ip_address = '10.95.159.100' & process_name = 'smbhash.exe' & pid = 1152`*\
*`--> @dm:addrow ip_address = '10.95.122.221' & process_name = 'svchost.exe' & pid = 1172`*\
*`--> @dm:dns_ip_to_name from_cols = 'ip_address' & to_cols = 'fqdn' & keep_value = 'yes'`*<br>

![Pipeline code](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-Mg7jS0KBp8Hz_BJdBO7%2F-Mg7kZUw9D8lNaEfVArY%2FScreen%20Shot%202021-08-02%20at%202.25.50%20PM.png?alt=media\&token=5e37ccc2-61d0-4b8a-a475-b498d23120cb)

Step &#x33;**:** Click verify button to verify the pipeline. RDA will verify the pipeline without any errors (as shown below)

![Pipeline code verified for any syntax errors](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-Mg7kfhXp8gEl7zIXahh%2F-Mg7kyvS8ooSvfAIG_wM%2FScreen%20Shot%202021-08-02%20at%202.27.38%20PM.png?alt=media\&token=9512b1ac-b13d-4bec-9fc8-80a52525908a)

Step &#x34;**:** Click execute button to execute the pipeline. RDA will execute the pipeline without any errors (as shown below)

![Pipeline code executed without any errors](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-Mg7l6id2BIiHcU6sad-%2F-Mg7lVhieDchMjLdWJwu%2FScreen%20Shot%202021-08-02%20at%202.29.56%20PM.png?alt=media\&token=9ee2bdb8-81b0-4669-899c-1648d95f012d)

Step 5: Verify that the ip\_address field as part of the dataset is resolved and print the FQDN (full qualified domain name) using DNS resolution as shown in the below screenshot.

![Pipeline uses RDA machines DNS resolution to resolve IP Address to FQDN as shown in the screenshot](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-Mg7lp7zeezXz0X76jQT%2F-Mg7mP_oMCrUWCZNoRD6%2FScreen%20Shot%202021-08-02%20at%202.33.53%20PM.png?alt=media\&token=11800293-06e6-40f0-a30e-718413a2b8c9)
