# Perspective - Scripting - Get Computer name and IP of client

**URL:** <https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [August 5, 2021, 8:29pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626 "2021-08-05T20:29:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![luc.martin](https://avatars.discourse-cdn.com/v4/letter/l/77aa72/32.png) [@luc.martin](https://forum.inductiveautomation.com/u/luc.martin)\
**Post date:** [August 5, 2021, 8:29pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/1 "2021-08-05T20:29:29Z")

</div>

8.1.7

Is ther a way to get the computer name and the IP address of the client

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 5, 2021, 8:52pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/2 "2021-08-05T20:52:56Z")

</div>

I think the `host` session prop is the closest thing you can get: [Session Properties - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Session+Properties)

---

<div class="post-metadata">

**Author:** ![luc.martin](https://avatars.discourse-cdn.com/v4/letter/l/77aa72/32.png) [@luc.martin](https://forum.inductiveautomation.com/u/luc.martin)\
**Post date:** [August 5, 2021, 9:07pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/3 "2021-08-05T21:07:39Z")

</div>

What I need is that tags available in Perspective

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/09785c988ba40ebc1650cadbe09d8394d7547d9b.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 5, 2021, 9:23pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/4 "2021-08-05T21:23:53Z")

</div>

There are `host` and `address` session props, but it’s not a certainty that the `host` will have been resolved to a hostname or just be an IP address.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 5, 2021, 9:43pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/5 "2021-08-05T21:43:22Z")

</div>

In 8.1.9 you'll be able to opt-in to a setting on the gateway that has the gateway do a reverse DNS lookup to attempt to verify the hostname based on the provided IP:

> "When enabled, Ignition's web server will attempt to resolve the remote HTTP client's hostname by performing a reverse DNS lookup using the remote HTTP client's IP address where appropriate, which could have a performance impact for each request which attempts a hostname lookup. When disabled, Ignition's web server will not attempt to resolve hostnames and any queries for the remote HTTP client's hostname will result in their IP address instead."

---

<div class="post-metadata">

**Author:** ![joostjojo](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@joostjojo](https://forum.inductiveautomation.com/u/joostjojo)\
**Post date:** [August 23, 2021, 1:18pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/6 "2021-08-23T13:18:34Z")

</div>

Can you provide more information where i can find this option?  
Because when I try to get my project or session information I came only across the hostname of the gateway or de ip adres of de router and not the ip adres or hostname of the pc I want to gather. This because they have multiple machines and the screen at Machine 1 may only see the downtimes at Machine 1 etc. but another role may see the downtimes of all machines. So i need to do something with the hostnames/ip adresses.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 23, 2021, 1:33pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/7 "2021-08-23T13:33:40Z")

</div>

This got “bumped” to 8.1.10 because of the unexpected release of 8.1.9, but when it’s available it can be enabled in `Gateway Web Interface > Config > Networking > Web Server`.

---

<div class="post-metadata">

**Author:** ![joostjojo](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@joostjojo](https://forum.inductiveautomation.com/u/joostjojo)\
**Post date:** [August 23, 2021, 2:01pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/8 "2021-08-23T14:01:10Z")

</div>

Any idea when the stable version 8.1.10 will be released?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 23, 2021, 2:02pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/9 "2021-08-23T14:02:53Z")

</div>

Estimate is the first half of September.

---

<div class="post-metadata">

**Author:** ![kyle.bennett](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kyle.bennett](https://forum.inductiveautomation.com/u/kyle.bennett)\
**Post date:** [August 23, 2021, 5:12pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/10 "2021-08-23T17:12:13Z")

</div>

So does that mean that the client IP address will also be available for use by chance?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 23, 2021, 5:33pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/11 "2021-08-23T17:33:40Z")

</div>

Keep in mind that this operation works on the IP address of the TCP (http) connection to the server from the **Server’s** perspective. Clients behind a NAT firewall will be seen as the firewall’s IP, and with the name of the firewall via reverse DNS.

Users familiar with Vision’s total access to the local computer will forever be disappointed at the lack of access via browsers.

---

<div class="post-metadata">

**Author:** ![derrickdvdsn](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@derrickdvdsn](https://forum.inductiveautomation.com/u/derrickdvdsn)\
**Post date:** [September 20, 2021, 2:25pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/12 "2021-09-20T14:25:44Z")

</div>

I have checked the ‘Resolve Client Hostnames’ option but only the IP is still being displayed. Is there any other way I can call the hostname of the client? like using system.net.getHostName or should I be looking at session.props.host?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 20, 2021, 2:36pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/13 "2021-09-20T14:36:06Z")

</div>

You must have the DNS infrastructure used by your gateway know the names for the IP addresses it sees. Clients themselves are not (cannot be) trusted.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 21, 2021, 5:11pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/14 "2021-09-21T17:11:29Z")

</div>

> [@derrickdvdsn](#):
>
> like using system.net.getHostName or should I be looking at session.props.host?

In Perspective you can only reference `session.props.address` and `session.props.host`. Reverse DNS lookups to turn an IP into a hostname are entirely dependent on DNS being set up in your network environment as @pturmel mentioned.
