.bat file to overwrite HOSTS file


Recommended Posts

VPuccetti

Alright, first i'd like to say Hi to everyone :)

Secondly, here we go. Im a server admin for a large LAN event here in New Mexico and i've just completed setting up our Linux/Apach2/Php/Sql server. We've got a LAN php program called ALP. Essentially id like gamers to be able and access this site through an Intranet name as opposed to having register it for a DNS name and whatnot.

As far as i know i have very little options. We're not using a doman and do not have a domain server because we have a T1 line coming in and using a router to do DHCP. So... any advice as to how I can either create a .bat file that will edit everyones HOSTS file when they obtain an IP OR!! an easy way to change everyones IP for a DNS server and create a DNS server on a linux machine as well.

We'll be having about 150 - 200 people, so... going up to each and every computer will NOT be fun.

I can always use the IP of the LAMP rig, but itd be nicer to have a name associated with it.

Link to post
Share on other sites
Unholy Moley!

Setting up the DNS server on the machine or setting up a dyndns.com account and using that would be the best options. I would use dyndns unless you already have a DNS server program installed on a linux box.

Link to post
Share on other sites
VPuccetti
Setting up the DNS server on the machine or setting up a dyndns.com account and using that would be the best options. I would use dyndns unless you already have a DNS server program installed on a linux box.

But i want this for intranet use. that way instead of typing www.paglan.com if they type in paglan, it will take them to the ALP web page instead of our main Internet lan page.

And if i set up a DNS server, I have to go to each computer and edit their tcp/ip and direct them to the Linux DNS box.

Link to post
Share on other sites
Joel
But i want this for intranet use. that way instead of typing www.paglan.com if they type in paglan, it will take them to the ALP web page instead of our main Internet lan page.

Yes, with the DNS you control. That's why he's saying setup your own DNS server.

And if i set up a DNS server, I have to go to each computer and edit their tcp/ip and direct them to the Linux DNS box.

Assign it in the DHCP settings of your DHCP server.

Link to post
Share on other sites
VPuccetti
Yes, with the DNS you control. That's why he's saying setup your own DNS server.

Assign it in the DHCP settings of your DHCP server.

I see, i forgot which router he uses and its a Linksys Wrt54g. Looked at it and I can set the Static DNS server. W00t, makes things a lot easier :) Forgot that the Router can set the DNS statically as opposed to doing it on each client.

Link to post
Share on other sites
+BudMan

So your going to be handing out dhcp using a wrt54g to a "large" event with 150 to 200 people?? Is it like 20 people per computer or something??

Please do not take this the wrong -- but how exactly does someone become the server admin for an event of that size, and not seem to have a clue on how to setup and run either a real dhcp server and or dns? Exactly what part of the servers do you "admin"? ;)

Hey a wrt54g dhcp table might be able to handle 200 leases.. To be honest never tested its limits, but come really an admin for an event that is going to have 150 to 200 people, and your dhcp is going to be a linksys router? Let me stress that again REALLY???

Maybe I am reading it wrong -- but normally with a "large" event with say 200 people -- the computer ratio to people would be somewhat close?

You got my curiosity up though -- what exactly is a "LAN php program called ALP" ??

Not sure what a domain has to do with having a machine run 2k3, so they have a server admin -- but no servers? Or for that matter any linux distro out there can provide you with dhcp and dns.

Tell you what.. here is a simple free dhcp server you can run on any windows machine

http://perso.orange.fr/philippe.jounin/tftpd32.html

As to DNS.. BIND would be the first one I would recommend - yes it will run on windows based machines XP home or pro, etc.. Instructions on setting it up on its website.. If you do not like that one, then there's powerDNS -- another FREE one, and instructions on use and setup on the website.. Or there is posadis

Better yet, here you go

http://www.simpledns.com/

Both a DHCP server and DNS.. FREE 14 day trial -- I think what woud cover the length of your event? Or if you want to buy only $80..

Have Fun and good luck -- I have a strange feeling your going to need it ;)

Link to post
Share on other sites
Jeston

Hmm, Albuquerque eh? Tempting to swing by there and check out the LAN, but I don't think I have the time.

Link to post
Share on other sites
MazX_Napalm

Large amount of people

Connecting to an unknown network

Having a script attempt to change their HOSTS file

I guess most people run some kind of security software that will report attempts to change system files. You are going to have some seriously p'ed off people.

Link to post
Share on other sites
n3rdw0p

I'm from Albuquerque too, don't have an answer for your question but I'm here lol we're rare.

Link to post
Share on other sites
VPuccetti
I'm from Albuquerque too, don't have an answer for your question but I'm here lol we're rare.

lol are you going March 30th? Its held at Intel again.

Edited by Unholee
Link to post
Share on other sites
VPuccetti
So your going to be handing out dhcp using a wrt54g to a "large" event with 150 to 200 people?? Is it like 20 people per computer or something??

Please do not take this the wrong -- but how exactly does someone become the server admin for an event of that size, and not seem to have a clue on how to setup and run either a real dhcp server and or dns? Exactly what part of the servers do you "admin"? ;)

Hey a wrt54g dhcp table might be able to handle 200 leases.. To be honest never tested its limits, but come really an admin for an event that is going to have 150 to 200 people, and your dhcp is going to be a linksys router? Let me stress that again REALLY???

Maybe I am reading it wrong -- but normally with a "large" event with say 200 people -- the computer ratio to people would be somewhat close?

You got my curiosity up though -- what exactly is a "LAN php program called ALP" ??

Not sure what a domain has to do with having a machine run 2k3, so they have a server admin -- but no servers? Or for that matter any linux distro out there can provide you with dhcp and dns.

Tell you what.. here is a simple free dhcp server you can run on any windows machine

http://perso.orange.fr/philippe.jounin/tftpd32.html

As to DNS.. BIND would be the first one I would recommend - yes it will run on windows based machines XP home or pro, etc.. Instructions on setting it up on its website.. If you do not like that one, then there's powerDNS -- another FREE one, and instructions on use and setup on the website.. Or there is posadis

Better yet, here you go

http://www.simpledns.com/

Both a DHCP server and DNS.. FREE 14 day trial -- I think what woud cover the length of your event? Or if you want to buy only $80..

Have Fun and good luck -- I have a strange feeling your going to need it ;)

Surprisingly enough it can handle DHCP leasing very well for large amounts of people. We had about 125 last time and had 0 problems. The gaming servers are uplinked with gigabit switches and every switch to peoples computers are gigabit as well. None of the servers had any lag and definetely no bottlenecking. Only problems we encountered were people using static ip adresses in their TCP/IP settings. I've already got the DNS server running though thx ;) Using DNSmasq (which can also be a dhcp server). Got it all up last night and working just fine.

As far as having another rig doing the DHCP, i've told the main guy who runs it we should try it. He doesn't think there will be a problem for the little linksys box to push out an extra 75 clients. But considering we're not loaded and are using most of our own private machines as servers, we're a little limited. A p4 2.8ghz 1gig computer is the ALP/SQL/Apache2 and now DNS server. An AMD FX-57 2gigs and x1800 is multiple BF2 servers, Multiple CSS servers, and about 4 CS 1.6 servers. Then we have an actual server rack that may do a lot of the filesharing (patches and that sort of things) and even more gaming servers. If you want to donate a computer as opposed to trying to mock something you haven't seen, I would be very greatful.

And ALP is "Autonomous Lan Party," which is a PHP "site" that helps run LAN's more smoothly. Essentially we can put in IP's of the gaming servers and people can just connect from the web site, they can create tech help tickets that are sent to admins, see results of tournaments, download files that we upload, see any news that we've posted, and see seating charts. Its basically to help make the tournaments faster so people see who they'll be playing against in which server and be able to connect to it w/out having to come up to us and constantly asking us. And a nicer thing is we can just port the SQL data from our website into ALP that way people don't have to register or anything, they just sign on and get to see whats going on AT the lan.

Large amount of people

Connecting to an unknown network

Having a script attempt to change their HOSTS file

I guess most people run some kind of security software that will report attempts to change system files. You are going to have some seriously p'ed off people.

It's not an unknown network and we'd make sure everyone was aware if we chose to do it that way. I just completely forgot that the router can do a static DNS and as soon as it was suggested, I got it all configured and done.

Edited by Unholee
Link to post
Share on other sites
+BudMan
And ALP is "Autonomous Lan Party," which is a PHP "site" that helps run LAN's more smoothly.
Well I have to say -- that software looks pretty slick! ;)

Honestly I was not trying to mock anything.. I just did not understand how someone that is suppose to be an admin for something like a 200 person lan party would need to ask how to setup dns or dhcp.. After they call themselves a "server" admin ;)

And DNSmasq is a great tool to provide dhcp and dns.. As I said before - Have Fun, and good luck.. Sounds like you wont need as much luck as I had thought ;)

Link to post
Share on other sites
VPuccetti
Well I have to say -- that software looks pretty slick! ;)

Honestly I was not trying to mock anything.. I just did not understand how someone that is suppose to be an admin for something like a 200 person lan party would need to ask how to setup dns or dhcp.. After they call themselves a "server" admin ;)

And DNSmasq is a great tool to provide dhcp and dns.. As I said before - Have Fun, and good luck.. Sounds like you wont need as much luck as I had thought ;)

I know how to set up DNS and DHCP, but was forgetting that I can create a DNS server and have the router point to it as the primary as opposed to altering HOSTS files or manually setting Static DNS on each computer. I've taken CCNA classes and have my MCSE cert, so i'm not ignorant ;) If you want to discuss subnet masking, ip schemes, active directory, etc... i'd be down :p Ive been teaching myself Linux on Ubuntu and OpenSuse 10.2. I have virtual rigs of Windows 2000 and Windows 2003, which is no problem but wanted to go the Linux route with this stuff. I just had a large brain fart the day i asked, but luckily someone brought it to my attention and i got it all done.

I'll take pictures for you guys and let you know how the LAN turns out. I'm almost thinking of piecing together all my scrap parts and buying a mobo to make the DHCP/DNS server seperate from the LAMP server.

But essentially i've already got network layed out and figured out. It's going to be a 10 class A series ip scheme of a starting DHCP of 10.0.1.6 - 1 for DNS/ 1 for DHCP server, 1 for LAMP, 1 for AMD rig, 1 for other server rig). And if do the DHCP server, i'm just going to have the T1 line going into our 24port giga-switch and then go from there.

If anyone knows of any other programs to help keep large gaming LANs under supervision and stuff let me know. (dont want people going to porn and that kinda stuff :))

Edited by Unholee
Link to post
Share on other sites
+BudMan
If anyone knows of any other programs to help keep large gaming LANs under supervision and stuff let me know. (dont want people going to porn and that kinda stuff :))
Just run a transparent squid proxy with squidguard and your fav blacklist.
Link to post
Share on other sites
VPuccetti
Just run a transparent squid proxy with squidguard and your fav blacklist.

Have you used Shalla's squidguard? Or do you use the original http://www.squid-cache.org/

Edited by Unholee
Link to post
Share on other sites
+BudMan

Nope never used that one - but have used this one

http://urlblacklist.com/

And a few others.. Like I said your fav blacklist ;) Or create your own from a few of them, etc..

Link to post
Share on other sites
VPuccetti
Nope never used that one - but have used this one

http://urlblacklist.com/

And a few others.. Like I said your fav blacklist ;) Or create your own from a few of them, etc..

Heh Shall's blacklist has over 1million entries now which is pretty cool, kinda ghetto that URLblacklist only allows 1 download lol

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.