# Perspective Client Hostname

**URL:** <https://forum.inductiveautomation.com/t/perspective-client-hostname/50604>\
**Category:** Ignition\
**Created:** [September 3, 2021, 3:30pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604 "2021-09-03T15:30:49Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [September 3, 2021, 3:30pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/1 "2021-09-03T15:30:49Z")

</div>

If Ignition 8.1.10rc is running in a Docker Container, on windows, will it be able to resolve the client hostname?

Gateway configuration:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/1/2120205edb2f3492cbabac921018fe6c4597f09b.png)

Session.props from a client

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dc23c9eb39cd308c4fe229264e0b9ab43395f0bf.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:** [September 3, 2021, 3:36pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/2 "2021-09-03T15:36:52Z")

</div>

If you’re running your docker container with the default bridged network setup then all the connections are going to appear to come from the network gateway (172.17.0.1) and DNS resolution is not going to do anything for you here.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [September 3, 2021, 3:37pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/3 "2021-09-03T15:37:08Z")

</div>

I also just noticed that the gateway setting does not survive a reboot.

---

<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:** [September 3, 2021, 4:04pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/4 "2021-09-03T16:04:40Z")

</div>

Are you mounting/persisting the `data` directory?

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [September 3, 2021, 4:14pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/5 "2021-09-03T16:14:58Z")

</div>

Yes the data directory is mounted in a separate volume that is persisted. Other gateway settings changes survive reboot just fine. I just tested with Ignition installed on the host and the setting does survive reboots. It appears as if this is just an issue when installed in a container.

---

<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:** [September 3, 2021, 4:36pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/6 "2021-09-03T16:36:01Z")

</div>

Ah, I did some digging, and it looks like that's expected behavior. The thing to do is pass the `resolveHostNames` flag in as a container argument:

> Docker image now supports passing arbitrary "gateway.\*=" key/value pairs for the gateway.xml after the double-hyphen in the command args, similar to the existing capability for JVM/wrapper args.

So you would add `gateway.resolveHostNames=true` to the container.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [September 3, 2021, 4:40pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/7 "2021-09-03T16:40:13Z")

</div>

Expected behavior for Docker only? Will the setting persist reboots on a VM?

---

<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:** [September 3, 2021, 4:42pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/8 "2021-09-03T16:42:24Z")

</div>

Yes. It’s only necessary for Docker.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [September 3, 2021, 5:03pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/9 "2021-09-03T17:03:45Z")

</div>

I just noticed that the data mount location is different in Inductive Automation’s images.

kcollins - /var/lib/ignition/data  
IA - /usr/local/bin/ignition/data

---

<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:12pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/10 "2021-09-20T14:12:53Z")

</div>

After the ‘Resolve Client Hostnames’ is checked, I am still getting the IP address of my Client instead of the hostname in the 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:31pm UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/11 "2021-09-20T14:31:31Z")

</div>

Client hostname resolution is a reverse DNS operation on the IP address seen by the gateway, not a value passed from a client. Don’t expect client browsers to ever be trusted to do so.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [April 18, 2022, 6:11am UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/12 "2022-04-18T06:11:40Z")

</div>

Hi,

You can try with system.net.gethostname on a button click or on any tag event script in tags to get hostname.

---

<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 18, 2022, 11:41am UTC](https://forum.inductiveautomation.com/t/perspective-client-hostname/50604/13 "2022-04-18T11:41:33Z")

</div>

> [@Sourabh\_Ambildhuke](#):
>
> try with system.net.gethostname

As noted in [the docs](https://docs.inductiveautomation.com/display/DOC81/system.net.getHostName), this yields the gateway hostname, not the Perspective client hostname.
