squirrellydw Posted March 29, 2017 Share Posted March 29, 2017 Does unraid have a "Hosts file" I'm trying to get a Plex plugin working and not sure what the issue is and thought it might be that. Someone wrote a Plugin for NHL hockey finally. I don't want to post a link to it for certain reasons. Quote Link to comment
trurl Posted March 29, 2017 Share Posted March 29, 2017 There is /etc/hosts but I've never heard of anyone needing to edit it. Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 (edited) 10 hours ago, trurl said: There is /etc/hosts but I've never heard of anyone needing to edit it. ok, I don't see /etc/hosts on the flash drive. What am I doing wrong? Edited March 29, 2017 by squirrellydw Quote Link to comment
saarg Posted March 29, 2017 Share Posted March 29, 2017 10 minutes ago, squirrellydw said: ok, I don't see /etc/hosts on the flash drive. What am I doing wrong? /etc/hosts are for obvious reasons not on the flash drive. Take a step back and look at the path again Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 4 minutes ago, saarg said: /etc/hosts are for obvious reasons not on the flash drive. Take a step back and look at the path again I'm confused, if the Hosts file isn't on the flash drive where would it be? Not talking about the one on my computer but on unraid Quote Link to comment
Frank1940 Posted March 29, 2017 Share Posted March 29, 2017 It is actually a part of the operating system that gets installed in the RAM of your server as it unzips the bz* files in the root of your Flash Drive. You need to go the command line to actually find the hosts file at /etc/hosts. To get to the command line, log in on the console or via a PuTTY session from your PC. You will need to learn some Linux Commands at this point to do but a google search should get a link to a introductory text. Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 thanks, so I found it and trying to add an IP to it but it doesn't seem to save it. sudo nano /etc/hosts control x and Y to save but when I look at the hosts file again what I added isn't there Quote Link to comment
trurl Posted March 29, 2017 Share Posted March 29, 2017 I question whether this is the solution for whatever your (secret) problem is. Hosts just gives names to IPs, sort of an override of DNS. Usually any time you need to specify a network location you can just use the IP instead of the name, Have you tried that? Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 (edited) @trurl I sent you a PM. If you don't want to respond I understand. If I could do the same thing through my router that would be great Edited March 29, 2017 by squirrellydw Quote Link to comment
ijuarez Posted March 29, 2017 Share Posted March 29, 2017 (edited) do you mean this Plex NHL it's no secret they have it on the plex forums Edited March 29, 2017 by ijuarez Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 no that one is old Quote Link to comment
ijuarez Posted March 29, 2017 Share Posted March 29, 2017 1 minute ago, squirrellydw said: no that one is old Well it can't be that secretive if a simple google search found it. Anyhow are you using the plex plugin (who's) or a docker? Quote Link to comment
Frank1940 Posted March 29, 2017 Share Posted March 29, 2017 1 hour ago, squirrellydw said: thanks, so I found it and trying to add an IP to it but it doesn't seem to save it. sudo nano /etc/hosts control x and Y to save but when I look at the hosts file again what I added isn't there Nano is confusing on what actually causes the file to updated. On exiting, You have to agree to save the changes. Use the following command to see if the date and time have been updated ls -al /etc Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 any other way to modify the hosts file other than Nano? Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 I think this might be the problem, after I type Y its asking "A File Name to Write" see attached, what do I pick. Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 lol wow I feel stupid, thanks Quote Link to comment
Squid Posted March 29, 2017 Share Posted March 29, 2017 Quick check though is that if you're running a Plex docker, then you have to start / stop the container for the local version of hosts that it uses to re-grab the one that unRaid uses. IE: You're going to have to make a separate hosts file on the flash drive and then edit /boot/config/go and add the line cp /boot/hosts /etc/hosts before the line that has emhttp in it so that it'll take effect with every boot. Quote Link to comment
squirrellydw Posted March 29, 2017 Author Share Posted March 29, 2017 so just create a text document, call it Hosts and put it on the root of the flash drive and edit the Go file. Why won't the default one work if the IP is added to it. So confusing Quote Link to comment
CHBMB Posted March 29, 2017 Share Posted March 29, 2017 (edited) Because the default one is unpacked from bzroot at boot, overriding any changes you made. Any changes made to the "OS" are non-persistent across reboots, bzroot contains all the OS files and are unpacked to RAM. Edited March 29, 2017 by CHBMB Quote Link to comment
Frank1940 Posted March 30, 2017 Share Posted March 30, 2017 You have to understand that unRAID does NOT run from the Flash Drive. The OS is stored in the files on that Drive and the actual OS is loaded into RAM --- think of it as a RAM disk --- and that unRAID uses those files in RAM to actually run the system. (Basically, unRAID uses Flash drive to initially load the OS into RAM and grabs some information from a few files in the config folder to modify some default settings. This takes most MB's about two minutes to do. The Flash Drive is basically unaccessed by the OS until you are ready to shut the system down. It will then write a Flag bit to a file in the config folder to indicate a proper shutdown.) If you want to modify a built-in configuration file, you have to do it every time that the OS loads. Most folks who do this simply copy the modified file from the RAM disk file to a folder on the Flash Drive and put a line in the go file as Squid suggested. Another way to thing about it is that the Flash Dive in unRAID is what the DVD Installation Disk is to Windows. And that RAM Disk is to unRAID as the hard drive (C:\) is to Windows! Quote Link to comment
bonienl Posted March 30, 2017 Share Posted March 30, 2017 7 hours ago, Squid said: Quick check though is that if you're running a Plex docker, then you have to start / stop the container for the local version of hosts that it uses to re-grab the one that unRaid uses. IE: You're going to have to make a separate hosts file on the flash drive and then edit /boot/config/go and add the line cp /boot/hosts /etc/hosts before the line that has emhttp in it so that it'll take effect with every boot. No, don't do that !!! The hosts file is dynamically generated by unRAID to ensure it contains the proper entries, do NOT overwrite this file. You can however add entries to the hosts file from your go file: echo "[ip] [name]" >> /etc/hosts For example echo "192.168.111.10 hostname.mydomain.com" >> /etc/hosts Quote Link to comment
Squid Posted March 30, 2017 Share Posted March 30, 2017 6 hours ago, bonienl said: No, don't do that !!! The hosts file is dynamically generated by unRAID to ensure it contains the proper entries, do NOT overwrite this file. You can however add entries to the hosts file from your go file: echo "[ip] [name]" >> /etc/hosts For example echo "192.168.111.10 hostname.mydomain.com" >> /etc/hosts Only problem then with appending the entries within go is that you can't guarantee when in the boot process unRaid creates the file. OP would be better off setting up a user script (set to run at array start) with the appropriate echo command. Quote Link to comment
Frank1940 Posted March 30, 2017 Share Posted March 30, 2017 A better alternative might be to request that LimeTech provide for the appending of a user generated hosts file to the default one that LimeTech provides. This could be done in much the same manner as is currently done with the smb-extra.conf file. Of course, this will require that someone with a truly vested interest in acquiring such an feature make the request and support that request with valid reasons for its need. Quote Link to comment
squirrellydw Posted March 30, 2017 Author Share Posted March 30, 2017 10 hours ago, Squid said: Only problem then with appending the entries within go is that you can't guarantee when in the boot process unRaid creates the file. OP would be better off setting up a user script (set to run at array start) with the appropriate echo command. would you like to mike that script? I have no idea how to do that. I could fill in the IP and name if you tell me where to put it. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.