# [PC-BSD] network alias



## kr651129 (Dec 9, 2013)

For the life of me I can't remember where to put this.  I have a jail on my PC-BSD system and from the base system I want to set up an internal alias for it so I can just type "tomcat7" in my browser instead of the IP and port, where would I put this?


----------



## fonz (Dec 9, 2013)

If you're not running a NAT/firewall, how about /etc/hosts?


----------



## kr651129 (Dec 9, 2013)

What service do I need to restart after changing the hosts file?


----------



## fonz (Dec 9, 2013)

kr651129 said:
			
		

> What service do I need to restart after changing the hosts file?


That would be none


----------



## kr651129 (Dec 9, 2013)

Thanks! I only ask because I made changes to /etc/hosts and it seems to have not taken effect on it's user error  :OOO

edit:
Here's my /etc/hosts entry:

```
192.168.1.201:8080      tomcat    tomcat
```


----------



## kr651129 (Dec 9, 2013)

Solved,  I thought I could put the port in there.... I can't.


```
192.168.1.201 tomcat tomcat
```

Then tomcat:8080/ from the browser works fine.  Thanks again for the help @fonz!


----------



## fonz (Dec 9, 2013)

I'm not entirely 100% absolutely positively sure, but I don't think you can put port numbers in /etc/hosts. If you want all inbound traffic for the jail to be redirected to a certain port number, you may have to set up a small NAT (e.g. using PF) on the host.
If your network has a domain name, add it to the middle entry: something like
	
	



```
192.168.1.201 tomcat.foobar.org tomcat
```
should do it.


----------

