# How to get the device/host Name on client server

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046>\
**Category:** Ignition\
**Tags:** ignition81, perspective, ignition80\
**Created:** [April 29, 2022, 11:43am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046 "2022-04-29T11:43:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [April 29, 2022, 11:43am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/1 "2022-04-29T11:43:51Z")

</div>

Hi all,

The script system.net.getHostName() returns the host/device name in local device and in client server it was returning the server name but instead of server name is their any chance to get the device name in the server side too.  
Do we have any inbuilt-function or script to get this requirement. please suggest something to solve this.

Thanks

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 29, 2022, 11:51am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/2 "2022-04-29T11:51:54Z")

</div>

Perspective is using the client’s web browser. All it can possibly know is what is sent by the browser and that is limited.

This may help: [How To Use Google Analytics To Find Out What Devices Your Customers Use](https://smartbear.com/blog/use-google-analytics-find-devices-customers-use/).

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 29, 2022, 12:18pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/3 "2022-04-29T12:18:52Z")

</div>

There’s a session prop for that, `session.prop.host` from memory. In later versions of ignition, this can\* be the actual hostname of the machine, but in older version it’s always the ip address. I believe there’s a new prop for ip address now in new versions

\*I’ll let someone else explain reverse DNS or whatever is needed here as I haven’t looked into it yet @paul-griffith?

---

<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:** [April 29, 2022, 2:08pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/4 "2022-04-29T14:08:50Z")

</div>

It is based on asking the gateway’s DNS provider to resolve the IP address the gateway sees as the client. If you are connecting from behind any NAT device, the name will be that NAT device’s name. In that case, the gateway _ **cannot know** _ the name of the actual client device.

Even if a browser _ **would** _ give you a device name, you can’t trust it–a hacked browser can _ **lie** _.

---

<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:** [April 29, 2022, 3:24pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/5 "2022-04-29T15:24:10Z")

</div>

See ‘Resolve Client Hostnames’, introduced in 8.1.10:  
[https://docs.inductiveautomation.com/display/DOC81/Web+Server+Settings](https://docs.inductiveautomation.com/display/DOC81/Web+Server+Settings)

---

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [May 2, 2022, 7:54am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/6 "2022-05-02T07:54:12Z")

</div>

Hi,  
Actually I am using the Trial version and I don’t have the SSL certificate.  
without SSL certificate it was not working.  
so, can you suggest any other ways or scripts which can be helpful please.  
Thank you

---

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [May 2, 2022, 8:02am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/8 "2022-05-02T08:02:25Z")

</div>

Hi,  
I am using the Trail version of Ignition 8.1.14 and still in this version, the session parameter host is returning the IP address.  
I have attached a screenshot for reference.  
can you suggest for other scripts or procedures that could be helpful to get host/device name of the client instead of IP address please.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/d/5dd8b2243f1ae8b26faeaab6a0559d53a778cfa8.png)  
Thank you

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 2, 2022, 8:03am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/9 "2022-05-02T08:03:55Z")

</div>

I refer you back to Paul's post:

> [@paul-griffith](#):
>
> Resolve Client Hostnames’, introduced in 8.1.10:  
> [https://docs.inductiveautomation.com/display/DOC81/Web+Server+Settings](https://docs.inductiveautomation.com/display/DOC81/Web+Server+Settings)

There is no other way to get the hostname in Perspective

---

<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:** [May 2, 2022, 2:17pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/10 "2022-05-02T14:17:37Z")

</div>

The use of SSL has nothing to do with your site’s DNS configuration. Your own DNS server (the one the gateway uses to resolve host name =\> IP) must also resolve IP =\> hostname. Neither the Ignition gateway nor the client browser do this. Your own network infrastructure must do it, and Ignition will respect that.

---

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [May 4, 2022, 4:40am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/11 "2022-05-04T04:40:00Z")

</div>

Hi,  
Is there any more unique options/features like MAC address other than host name and ip address that we can get it from the client device in ignition perspective.  
can we get MAC address of the client machine using the ignition if possible please.  
If any please suggest them and also help in me in getting those details.  
Thank you

---

<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:** [May 4, 2022, 8:42am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/12 "2022-05-04T08:42:04Z")

</div>

If you really need high-confidence access to such information, switch to Vision. Perspective cannot do this.

---

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [May 17, 2022, 8:07am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/13 "2022-05-17T08:07:30Z")

</div>

Hi All,  
We have a session Parameter Named Device Identifier. we observed that the **Device Identifier** parameter value was changing upon changing the browser(Google Chrome, Edge…).  
Also, Is this Device Identifier Value changes upon change of IP Address(Dynamic)?  
If Yes, then could you please suggest some other session parameters/values that should not change with respect to IP Address/browser and should be unique for each device.

Thanks

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 17, 2022, 9:37am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/14 "2022-05-17T09:37:50Z")

</div>

What about the very prop this post is about, the `host` session prop?

---

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [May 17, 2022, 10:20am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/15 "2022-05-17T10:20:25Z")

</div>

Device Identifier Session Prop.

---

<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:** [May 17, 2022, 12:07pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/16 "2022-05-17T12:07:13Z")

</div>

> [@Arun\_Teja\_Gattu](#):
>
> If Yes, then could you please suggest some other session parameters/values that should not change with respect to IP Address/browser and should be unique for each device.

Not possible when browsers are involved. The device ID has to be stored in a cookie or browser-local storage, and that can be wiped out by users at any time. And each browser and user profile on a desktop maintains its own cookies and in-browser local storage. Using the mobile app should give you a more reliable device ID. IIRC, even that isn't guaranteed.

If you absolutely must identify the local machine running your client, you should have picked Vision, not Perspective. Vision can run local code to extract durable identifiers like network device MAC IDs, BIOS or hard drive serial numbers, and similar. Perspective cannot.

---

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [May 17, 2022, 12:55pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/17 "2022-05-17T12:55:03Z")

</div>

Is there a way to get the identifiers from vision and send that to perspective?  
If Yes, please suggest the procedure to do this.

---

<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:** [May 17, 2022, 2:01pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/18 "2022-05-17T14:01:18Z")

</div>

> [@Arun\_Teja\_Gattu](#):
>
> get the identifiers from vision and send that to perspective?

No. Vision is an _ **alternative** _ to Perspective. You would create your client graphics in Vision instead of Perspective. Ergo the "should have". Doing it now means you have to start over. (Vision and Perspective are fundamentally different technologies.)

---

<div class="post-metadata">

**Author:** ![Arun\_Teja\_Gattu](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Arun\_Teja\_Gattu](https://forum.inductiveautomation.com/u/Arun_Teja_Gattu)\
**Post date:** [May 20, 2022, 9:45am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/19 "2022-05-20T09:45:47Z")

</div>

Hi,  
The function system.net.getHostName() is returning Host Name on gateway and on server side it is returning the server Name instead of Host Name.  
Is there any function or session Parameters that can be used to get this functionality done in perspective only and without using the Reverse DNS.  
If we cannot get the Host Name on the server side, Is there any unique Parameters for each device that can be used in place of Host Name and it should not be changing.

Thanks

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 20, 2022, 10:09am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/20 "2022-05-20T10:09:19Z")

</div>

You need to research on browser security and privacy. In the wider Internet context what you are asking for might allow a web host to identify your device and this could compromise your security.

Have a read of [Is your device as unique as you are? Spoiler: Almost.](https://nudatasecurity.com/resources/blog/is-your-device-as-unique-as-you-are/).

---

<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:** [May 20, 2022, 12:04pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/21 "2022-05-20T12:04:54Z")

</div>

> [@Arun\_Teja\_Gattu](#):
>
> Is there any function or session Parameters that can be used to get this functionality done in perspective only and without using the Reverse DNS.

No. Sorry. You are going to have to rethink your entire design if this is a hard requirement.

[Next page](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046.md?page=2)
