Access jail with host name

Status
Not open for further replies.

Vijai

Cadet
Joined
Dec 1, 2014
Messages
5
Hello all,
I have successfully configured everything i need so far. I have a jail running a small webserver with static ip assigned via my router's DHCP. I could access the server via the IP but not with the hostname (the jail's name). I tried tracert on the IP which naturally returned no hostname. I would be happy if someone could guide me setting up the hostname as the server would mostly be accessed in lan only. Accessing it with wan works flawless
 
Joined
Dec 26, 2013
Messages
18
Hi Vijai,

One very simple way to access your jail system with a hostname instead of an IP address would be to put an entry in the hosts file of the system from which you wish to connect.

If you need to connect from OS X or Linux, put an entry for your jail in /etc/hosts. On Windows, I believe it's something like C:\Windows\System32\Drivers\etc\hosts. The format is just a new line with the IP address of the machine, white space, and the host name you want to use. For example:

10.0.0.202 jinglebells

Then, when you type "ssh jinglebells" or "http://jinglebells" your computer looks up the IP address 10.0.0.202 in the hosts file, short-cutting DNS.

I recently upgraded to a PFSense router, which includes super-fancy magicalness as a standard feature. I can give all the systems on my LAN DHCP hostname/nicknames, and it adds the nicknames to DNS automatically, without the need to edit all the hosts files on my systems. Don't know how it works yet, but it's very nice.

Somewhere between these extremes you may find the perfect solution for you.


Steve.
 

Vijai

Cadet
Joined
Dec 1, 2014
Messages
5
I guess my router doesnt have that function. Though your first option is viable, I cannot edit each system's host files or ask anybody from outside to edit his. If I could access the freenas control panel with hostname, I should also be able to assign a host name for the jail right?
 
Joined
Dec 26, 2013
Messages
18
Hi Vijai,

Salient points! FreeNAS advertises its presence to the LAN using Zeroconf (Netatalk/Bonjour) and likely other services. That is how you can access the FreeNAS box without using its IP. You could install a Netatalk service in your jail, if you're connecting from Macs. There must be an equivalent service for Windows platforms (NetBIOS?).

I'm a bit vague on how it works, but it's pretty easy to set up Netatalk, and there are plenty of guides to setting it up online. Likely other people here can provide details if needed.


Steve.
 

Vijai

Cadet
Joined
Dec 1, 2014
Messages
5
Thank you for your help @Steve Lumponalog . It would be really helpful if some provides me a guide to do that. At present, there would be only windows and few linux machines. Mac should be al most 0. though if it works on linux, i guess it should work on os x also right?
 
L

L

Guest
You must be using a nameservice somewhere on your network? DNS or ldap or ad? Where ever they are getting hostname to ip translation is where you want to add the freenas.
 
Joined
Dec 26, 2013
Messages
18
I had a quick scamper around the web, but this topic appears to be much deeper and more complex than I thought, if you're trying to get it to work on Windows systems. The Avahi daemon (a multicast DNS service) only seems to work out-of-the-box for Linux and OS X systems. This question on Stack Overflow suggests that Windows systems need to have a third-party mDNS package (for example, Apple Bonjour) installed to work, which is probably not ideal for your situation.

If you can find a Universal Plug and Play (UPnP) client that installs in a jail, it may work in both Windows and Linux. You may have some luck with some of the UPnP clients in the FreeBSD ports tree. I think this is probably the path that you may want to follow – but I'm beyond the edge of my experience here.
 
Status
Not open for further replies.
Top