• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Hosts file editing

Joined
Jul 4, 2012
Messages
574 (0.12/day)
Location
Australia
Processor Intel® Core i5 6600
Motherboard Asus H170 Pro Gaming
Cooling Hyper 212 Evo
Memory G.Skill Ripjaws V Series 16GB DDR4 2400mhz
Video Card(s) Gigabyte Geforce GTX 960 G1 4GB Gaming
Storage 256GB Intel SSD 525 Series
Display(s) 24" LG LED Monitor
Case Corsair Carbide 200R
Power Supply Seasonic MK12II 620W
Mouse Logitech G5
Keyboard Logitech G110
Software Windows 10 x64
Hey guys,

So I work for a school and to this date we have supplied computers to all on campus, now the way we have been operating is we have an "Internet @home" and a "Internet @School" on the desktop. These shortcuts then do an xcopy a hosts file which over rights the one in C:\windows\system32\drives\etc\hosts
which allows them to use the school or home internet. It also adds a reg key that puts in all the settings required in IE. so that all has been good. You just run the appropriate shortcut it does its thing and away you go.
NOW we have started a BYOD program and MAC's have appeared. Is it possible to do this same thing on a mac? Because we run a proxy and obviously this would stop them getting on the internet at home if it had a proxy in it for school internet.

Your thoughts and ideas are most appreciated!!

JG ;)
 
OSX has a hosts file yes, unfortunately i dont know its location

this system sounds ghetto though, hosts/dns entries should be controlled at the router level unless this is for the clients to be able to use it all over the place (not in the same building/internet pipe)

what are the IE settings for?
 
We would be better off using the MAC address's of each machine to deermine the IP each time? so that each machine can be given a reservation on the network then be paired an IP to their MAC address. Yea? I definitely agree that this way is pretty ghetto at the moment.

Like this:
http://www.smallbusinesscomputing.c...9551/Networking-With-Address-Reservations.htm


The IE settings are just the standard, no popups, homepage, don't ask for location etc.
 
OSX has a hosts file yes, unfortunately i dont know its location

this system sounds ghetto though, hosts/dns entries should be controlled at the router level unless this is for the clients to be able to use it all over the place (not in the same building/internet pipe)

what are the IE settings for?

Mac is Unix based so it's in /etc/hosts
 
I am sorry but I have to say you are doing this all wrong. What is the point having separate hosts files? You are trying to control a network level thing using OS software. You need to setup a VPN for those you want to allow to connect to your network remotely. Then you need a domain controller so that those employees who want local access to your network have to login to the domain. Finally, you need a nameserver that each desktop points to. Yikes, if there was a security breach at your place of business I would not want to be the guy responsible for sorting it out!!
 
They are not accessing our system remotely at all. I am just talking about a hosts file for their home internet and a hosts file for their school internet. So when they go home their internet at home still works, otherwise with the proxy in for the school internet it would obviously not work! =P
But thank you, I know their are MUCH better ways out there.
 
so wait, how are they connecting at school for a hosts file to even be needed?

wired for example, connect to home ethernet that goes into router that goes into the world, just plug in & go.... at school, plug in to outlet... goes to router.. school network... how can it just not work?

i find it strange since the hosts file simply points domains to ips, so that's only useful for blocking things or enabling a private domain that you opt-in to have access to (well anyone would have access anyway if you directly use the ip without the domain)
 
I have to jump in and say I use, and have used the host file for years. It's an easy way to take stress off of old name servers. I don't add everything, but major shares I do add to the host file. I've used the host file for some tunneling as well. I try to optimize my network as much as possible and I have a solid network. But Easy Rhino is right as well, you'll want to have everything he suggested as well. :toast:
 
What happens if you have to add a new server or the IP of a server changes? Do you ask for everyone to return their laptops for a day while you painstakingly update each individual one?
 
What happens if you have to add a new server or the IP of a server changes? Do you ask for everyone to return their laptops for a day while you painstakingly update each individual one?

you can xcopy from unc paths. so technically only those addresses need to be static and you would only need to update the amount of original hostfiles you wish to use. in this case 2
 
What happens if you have to add a new server or the IP of a server changes? Do you ask for everyone to return their laptops for a day while you painstakingly update each individual one?

Naw, just change the login script to run a bat file that changes it on startup. ;) easy pesy :toast:

EDIT: Solaris17 you beat me.. My 1 year old is wide awake and wants to press every button on the key board.. lol
 
Naw, just change the login script to run a bat file that changes it on startup. ;) easy pesy :toast:

How is he going to change the login script? He doesn't have domain access to the machines.
 
What happens if you have to add a new server or the IP of a server changes? Do you ask for everyone to return their laptops for a day while you painstakingly update each individual one?
How is he going to change the login script? He doesn't have domain access to the machines.

He who? The end user never see's it or even knows what a host file is or what it does. The login script is at the PDC level where I have control over it. I have a primary host file in a shared location (Now this host file does nothing in the shared location.) I wrote in the startup script to check that file if the last time it was updated has changed (In the event I add or changed something on the network.) then the old host file on the computer connecting's would be updated. :toast: ;) That's as short and simple as I can put it buddy. It's all smoke, and mirrors . :p or some would say magic.. lol ;) It's just one of the simple low cost methods I've used where the IT department has no money.. hehehe

EDIT: I'm half asleep.. Just got up from a short nap. I think I know where you are not under standing me buddy. These are local network pc's that are on the domain.
 
Last edited:
But you have to have direct access to the machine to edit its startup script. So you still need to manually edit files for each machine.
 
But you have to have direct access to the machine to edit its startup script. So you still need to manually edit files for each machine.

Nope your wrong buddy. I've been doing this for years. You set the Login script for each user when you create their account on the Domain controller (Example : PDC = Primary Domain Controller). You can have as many scripts as you want or one for each user, but if you do that then your looking for a lot of work down the road. I usually create Office, floor, etc.. scripts and just update those scripts as needed. :toast:
 
(as an aside, i dont think telling your users to download an updated script from an email/news post & having them run it is a problem, that way you crowdsource the access to the individual clients)
 
(as an aside, i dont think telling your users to download an updated script from an email/news post & having them run it is a problem, that way you crowdsource the access to the individual clients)

I don't know if I understand, "Who is tell who to down load what?". Nobody even see's the script or even know what the login script is used for.. It's something set at the DC level and when the user logs into a pc it reads the script. I've lost you guys or something.. Maybe it's me that's lost who knows.. I can't be the only person in the world that uses login scripts in the active directory for users, which is on the directory controller. And all I wanted to do is add that I use the host file at times as well. :p I'm a sucker for the gift of sharing. :p
 
Back
Top