# \[FEATURE-1260\] Perspective Security Zone Host Name

**URL:** <https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 2, 2020, 11:33am UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126 "2020-12-02T11:33:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [December 2, 2020, 11:33am UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/1 "2020-12-02T11:33:51Z")

</div>

Hi,

I’d like to use the security zones to restrict unauthenticated Perspective project access to a select few fixed HMIs. Setting up a zone using the host names is ideal, but the browser session does not expose the host, only the IP.

Designer:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/b/6b15df4b183744ae8554f9512d5ff3291e6c497d.png)

Browser:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/4/d4f9d30a5818b22bcb230c95a6c702d98f1bc9ef.png)

The effect is that any security zone set up by host name does not correctly pick the computer. Works perfectly by IP address.

Host is preferred as I never know what happens to the DHCP reservations.

Can this work somehow?

Regards,  
Deon

---

<div class="post-metadata">

**Author:** ![jdahlinger](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jdahlinger/32/15735_2.png) [@jdahlinger](https://forum.inductiveautomation.com/u/jdahlinger)\
**Post date:** [December 3, 2020, 6:31pm UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/2 "2020-12-03T18:31:25Z")

</div>

I don’t see a way round this right now. I’ll log a feature ticket to explore a solution. It will most likely have to rely on the gateway’s ability resolve a host name using reverse lookup on the session IP.

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [December 3, 2020, 11:31pm UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/3 "2020-12-03T23:31:35Z")

</div>

Thanks.

For the time being, I’ve requested DCHP reservation and used the IP.

---

<div class="post-metadata">

**Author:** ![tony.petruzzi1](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tony.petruzzi1](https://forum.inductiveautomation.com/u/tony.petruzzi1)\
**Post date:** [April 22, 2021, 3:36pm UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/4 "2021-04-22T15:36:26Z")

</div>

Is there any traction on this? I just hit this restriction as well since i would like to create memory tags based on host names and store information in them.

---

<div class="post-metadata">

**Author:** ![jdahlinger](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jdahlinger/32/15735_2.png) [@jdahlinger](https://forum.inductiveautomation.com/u/jdahlinger)\
**Post date:** [April 22, 2021, 4:48pm UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/5 "2021-04-22T16:48:19Z")

</div>

It’s still on our backlog and has been reviewed, although development work has not yet begun.

---

<div class="post-metadata">

**Author:** ![tony.petruzzi1](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tony.petruzzi1](https://forum.inductiveautomation.com/u/tony.petruzzi1)\
**Post date:** [April 23, 2021, 12:29pm UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/6 "2021-04-23T12:29:55Z")

</div>

Facing the same problem. Here is a script I put together to get the HOSTNAME via NSLOOKUP. You can add this to your Project Library.

```auto
def GetHostName(Host):
	"""
	This will do an nslookup and get back the results like below 
	
	Server: dns1.example.com
	Address: 172.20.5.5
	
	Non-authoritative answer:
	Name: LAPTOP.example.com
	Address: 10.50.6.6
	
	it will then parse the output plucking the "Name:" line and
	returning the FQDN for the client.
	"""
	import subprocess
	# perform the nslookup
	proc = subprocess.Popen(["nslookup", Host], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
	output = proc.stdout.read()
	# convert the output to a list (array)
	lines = output.split('\n')
	name = ""
	# look for the "Name:" line	
	for line in lines:
		if "Name:" in line:
			name = line
	# return if we don't find it
	if not name:
		return name
	# split the name line into a list and return the last part (FDQN)
	# make sure to strip it
	return name.split(' ')[-1].strip()

```

---

<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 24, 2021, 10:42am UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/7 "2021-04-24T10:42:47Z")

</div>

May not need an external process.

```auto
from java.net import InetAddress

def getHostName(host):
	ia = InetAddress.getByName(host)
	return ia.getCanonicalHostName()

```

More reliable techniques with `javax.naming.directory` on stack overflow. Also with no subprocess or parsing.

---

<div class="post-metadata">

**Author:** ![tony.petruzzi1](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tony.petruzzi1](https://forum.inductiveautomation.com/u/tony.petruzzi1)\
**Post date:** [April 26, 2021, 1:02pm UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/8 "2021-04-26T13:02:57Z")

</div>

tried it but I keep getting an Expression Error. I don’t think it likes the [java.net](http://java.net) import. I am placing this in the Project Library. Maybe i’m supposed to be placing it somewhere else?

from [java.net](http://java.net) import InetAddress

def GetHostName(Host)  
ia = InetAddress.getByName(Host)  
return ia.getCanonicalHostName()

---

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [August 2, 2021, 3:03pm UTC](https://forum.inductiveautomation.com/t/feature-1260-perspective-security-zone-host-name/41126/9 "2021-08-02T15:03:17Z")

</div>

The latest 8.1.9 early access build includes a new capability to opt-into client hostname resolution. For more detail, see: [Nightly 8.1 Changelogs - 2021 - #128 by sreis](https://forum.inductiveautomation.com/t/nightly-8-1-changelogs-2021/42410/128)
