199 lines
11 KiB
Plaintext
199 lines
11 KiB
Plaintext
|
|
Episode: 91
|
||
|
|
Title: HPR0091: Hosts File
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0091/hpr0091.mp3
|
||
|
|
Transcribed: 2025-10-07 11:23:09
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
Outro Music
|
||
|
|
Welcome to this episode of Hacker Public Radio, this is Zokien and I'll be your host
|
||
|
|
for today.
|
||
|
|
I'm going to be talking about the host's file, but before I can do that, I've got to
|
||
|
|
explain a little bit about DNS and the internet and how it works roughly.
|
||
|
|
Every computer has been given a unique number or IP address.
|
||
|
|
Think of this as a phone number.
|
||
|
|
For the purposes of this analogy, imagine that you always have to enter the area code.
|
||
|
|
Now to get to another computer you need a CypHS or phone number, otherwise you can't
|
||
|
|
talk to it.
|
||
|
|
I mean, if you've got the phone, you need to know the phone number because otherwise
|
||
|
|
you don't dial it.
|
||
|
|
Now what you can do is phone the yellow pages up and ask to be put through to someone.
|
||
|
|
So there is this yellow pages containing everyone's name and number.
|
||
|
|
If you want to phone Google, you just look them up in the yellow pages.
|
||
|
|
However, instead of this being your local yellow pages because the numbers change too
|
||
|
|
quickly for that to work, you can actually phone another number up first for the operator
|
||
|
|
if you will.
|
||
|
|
And they will give you the phone number for Google.
|
||
|
|
Now in actuality, you don't need to use the yellow pages because the computer does this
|
||
|
|
for you.
|
||
|
|
You type in google.com and it looks up the phone number and dials it.
|
||
|
|
You can put the phone number in direct vote for a quick demonstration.
|
||
|
|
If you open up a command line or terminal in Windows, the Windows key and R should bring
|
||
|
|
up a run program dialog if not start run.
|
||
|
|
You can enter CMD if you're on Vista or XP in 2000.
|
||
|
|
I think it is or command if you're on 95 and 98.
|
||
|
|
Click OK and it will open up the terminal and in Linux, it depends on the Windows manager
|
||
|
|
and distro and whatever you're on.
|
||
|
|
I'm sure you probably know how to do that just open up a terminal or be under there somewhere.
|
||
|
|
So in the Windows, it's just open up.
|
||
|
|
You have to have a ping, it's P-I-N-G, Papa, India, November, Gulf, then it's space www.google.com
|
||
|
|
and press Enter and it will run something and tell you something back, something like
|
||
|
|
ping www.google.com, open brackets 208.67.219.231, close brackets and then a certain amount
|
||
|
|
of data, bytes of data and percentage that it worked and didn't work.
|
||
|
|
If you're on Linux, it will probably keep running forever so you need to control C out
|
||
|
|
of this.
|
||
|
|
Now the number there 208.67.219.231 is the phone number of Google.
|
||
|
|
Well, one of the phone numbers.
|
||
|
|
They have lots of people phoning, so they have several phone numbers.
|
||
|
|
But you open up the web browser and Firefox or whatever you use and enter 208.67.219.231
|
||
|
|
or whatever number you just found out in the address bar and hit Enter and hey, press
|
||
|
|
don't, it loads Google app.
|
||
|
|
You type the number into the computer, you don't have to look it up.
|
||
|
|
You can do this with any page you want, in fact.
|
||
|
|
But what's the point because phone numbers change, it's all dynamic.
|
||
|
|
You can pay for static IP addresses but it's normally much more expensive.
|
||
|
|
So people use like dns.com and software if they want to do stuff like that, but there's
|
||
|
|
no real point.
|
||
|
|
Your IP address is changed, so there's no point as you remember that, you just remember
|
||
|
|
Google.
|
||
|
|
That's the whole point of it.
|
||
|
|
It's designed to be human readable, Google.com is a lot easier to remember than 208.67.
|
||
|
|
Whatever the number was, see you've forgotten already, 208.67.219.231.
|
||
|
|
I've got it written in front of me that's the only reason I know.
|
||
|
|
Google.com, everyone can remember that.
|
||
|
|
So the whole dns thing is basically a yellow page is looking up computer rest of the phone
|
||
|
|
numbers for them.
|
||
|
|
This is a huge simplification if you actually know a lot more about dns and want to talk
|
||
|
|
about it, feel free to do your own hack public radio episode.
|
||
|
|
But that's basically enough for my purposes to explain the hosts file here.
|
||
|
|
The host file is a bit like a piece of paper you have next to the phone, where you write
|
||
|
|
phone numbers down.
|
||
|
|
Now you can write any phone number you want, you can write the wrong phone number.
|
||
|
|
This becomes important in a moment.
|
||
|
|
When you try and go to a website, instead of phoning yellow pages, you look up on the
|
||
|
|
bit of paper first.
|
||
|
|
You look up on the host file.
|
||
|
|
Once we're talking about yellow pages actually, let's talk about other people's frameworks.
|
||
|
|
There are several copies of the dns records around this, like one master copy, but it's spread
|
||
|
|
out to, I think it's five other master servers around, I think it's five anyway.
|
||
|
|
But there is a certain number of master records around on the internet.
|
||
|
|
If you actually took these out, the internet would pretty much die, but that's another story.
|
||
|
|
There are the master ones, but there are also local copies, which the ISPs normally hit
|
||
|
|
their own copies, so whichever ISPs you use, they have their own copy.
|
||
|
|
If you go into the network settings, you will be able to see that there will be a dns settings,
|
||
|
|
a dns server, one dns server, two dns server, three and so on.
|
||
|
|
That'll be your local ISPs.
|
||
|
|
You can use other ones, one common one, for example, is open dns, which I will link to
|
||
|
|
in the show notes.
|
||
|
|
They have several choices of phone books you can use, in fact, they have a child phone
|
||
|
|
click one.
|
||
|
|
For example, you can set up on your kid's machine, it went in and go to any porn sites.
|
||
|
|
I know.
|
||
|
|
Depressing.
|
||
|
|
Stopping porn off the internet.
|
||
|
|
They also do other things.
|
||
|
|
They block sites that they think are spammers, for example, that lots of people complain
|
||
|
|
about.
|
||
|
|
So you can stop the machine getting hacked, which is pretty cool, and I do actually use
|
||
|
|
open dns myself.
|
||
|
|
I didn't set it up on my machine, though, I got my machine to point to the router, or
|
||
|
|
router, if you're American.
|
||
|
|
So my computer, the wireless computer, connects to the router.
|
||
|
|
The router that looks up on the open dns servers to find out where it's meant to be going.
|
||
|
|
This is quite cool, because then all you need to do is change the router.
|
||
|
|
You don't need to faff around doing other things, and it can cache copies of it, so you
|
||
|
|
don't need to keep looking at the phone numbers and stuff.
|
||
|
|
So that's pretty cool.
|
||
|
|
Anyway, back to the hosts file.
|
||
|
|
It will be located in first places.
|
||
|
|
If you're on the Mac, it's private, etc. hosts apparently.
|
||
|
|
At least that's what Google told me.
|
||
|
|
On Windows, it's C kind of backslash, Windows backslash, system 32 backslash, drivers backslash,
|
||
|
|
etc. backslash hosts.
|
||
|
|
On Linux, it's simply slash, etc. slash hosts.
|
||
|
|
Need to mention the Windows file here.
|
||
|
|
They do have a file, hosts.sam, which stands for sample.
|
||
|
|
If you put anything in there, it doesn't do anything, which I found out when I first
|
||
|
|
started playing around with this.
|
||
|
|
You need to rename it to hosts, just plain hosts.
|
||
|
|
If you use notepad, gotta be careful, because it will try and put hosts.text.
|
||
|
|
The Linux file does exist and does already contain stuff, and it's quite important, because
|
||
|
|
if you overwrite the file, which I did on the friends computer, it killed Sude.
|
||
|
|
And it couldn't run, and half the stuff didn't work, because it uses the local IP address
|
||
|
|
it seems.
|
||
|
|
So gotta be very careful about that, and I ended up having to grab a live CD to fix it.
|
||
|
|
Once you've done changes, you can reboot to fix it.
|
||
|
|
Or in Linux, you should be able to do a kill all the dash, hub, iNet, D to restart it.
|
||
|
|
And those are probably the way, but it caches it.
|
||
|
|
I found generally so reboot the easiest way, just to make sure everything's flushed.
|
||
|
|
And there's an example hosts file at www.nvps.org-winhelp-2002-host.com.
|
||
|
|
I will put that in the show notes.
|
||
|
|
The basic format though, is you put the IP address and then the URL, for example, if you
|
||
|
|
want to connect to your local machine, let's say you're running a scroll mail or something
|
||
|
|
you want to connect to your own machine, you can put 127.0, 0.0.1, which is your local
|
||
|
|
machine, space, mail.
|
||
|
|
And then you type in mail in your address bar, and your browser, and it will take you
|
||
|
|
to your local machine.
|
||
|
|
Pretty cool.
|
||
|
|
I've got a setup for the DSL and the router, for example, mainly just some lazy.
|
||
|
|
And I had some issues originally, I kept changing the IP address and could never remember
|
||
|
|
them.
|
||
|
|
So I've got a setup, so I'm just type DSL or router, and it shows me where it is.
|
||
|
|
So this is the cool thing.
|
||
|
|
Using the wrong phone number, double-click.net, suck.
|
||
|
|
They have ads on about the entire internet, it seems.
|
||
|
|
There's also issues that my space, for example, served ads up from, may not have been double-click,
|
||
|
|
but it was one of these, and the server got hacked, the ad server got hacked.
|
||
|
|
Then all you need to do is load my space, suddenly your machine's hacked by this ad.
|
||
|
|
My space itself was secure, but the ad server wasn't.
|
||
|
|
And there are a bunch of 12-year-olds that got hacked on this.
|
||
|
|
Which is really bad.
|
||
|
|
So what you can do is if you don't want to see a double-click ad ever again, you add
|
||
|
|
a new life for 1-27.0.0.0.1, space, double-click.net.
|
||
|
|
So you're saying double-click.net is on my local machine.
|
||
|
|
So what then happens is you go to a website, there's a double-click ad there.
|
||
|
|
It says, oh, double-click.
|
||
|
|
I need to go there.
|
||
|
|
This in the host file, oh, it's on the local machine, looks on the local machine, can't
|
||
|
|
find it, gives you a 404 error for it.
|
||
|
|
However, the rest of the web page loads up because that's different address, and you
|
||
|
|
may end up with a small iframe saying 404 error or a blank or whatever, but you will
|
||
|
|
not get the ad.
|
||
|
|
This is really cool.
|
||
|
|
It says you're bandwidth as well, and I highly recommend it for most sites.
|
||
|
|
If you like the sites, if you like the sites, you want them to have money from the ads.
|
||
|
|
Basically, if it's a project that you like, don't do this, but if it's something big
|
||
|
|
like my space and they're being idiots, feel free to do it.
|
||
|
|
Oh, let you figure out the morality of what you feel is right for that or not.
|
||
|
|
Personally, I'll be tempted to just say block all the ads and just give donations to the
|
||
|
|
people you like, because then it saves them anyway.
|
||
|
|
But this is a really cool web blocking ads.
|
||
|
|
Now, I used to do this a lot, and I said this is MVPS website that they have a copy of
|
||
|
|
one that blocks pretty much all the sites, and all the really bad dodgy ones and spammers
|
||
|
|
and stuff.
|
||
|
|
It blocks a ton of websites that you don't want to go to, and it's really cool.
|
||
|
|
I've moved on to Privacy, though, from there, and I now is using Squid as a proxy server,
|
||
|
|
and I'm using that for a lot more because I'm getting it to control my cookies and things
|
||
|
|
as well as blocking the ads out.
|
||
|
|
But that's really cool, and I highly recommend it.
|
||
|
|
That's all I'm going to say for now.
|
||
|
|
A nice short episode, again, I try not to make these too long.
|
||
|
|
Sometimes if you end up with a four-hour show, it's just a bit, but ignoring the fact
|
||
|
|
it's a huge download, it's just way too long to listen to, so I try and keep these sort
|
||
|
|
of 10, 15 minutes long, just a little bit of information.
|
||
|
|
Just because after about 20 minutes of brain starts seizing up and you forget things and
|
||
|
|
you stop listening properly, so let's just try and keep these nice and brief.
|
||
|
|
I'd like to give a shout out to everyone in the RC chat rooms that talked to me, everyone
|
||
|
|
that's giving me feedback.
|
||
|
|
Everyone says, thank you.
|
||
|
|
This has been Soak.
|
||
|
|
If you want to talk to me, my website is Soak.org.
|
||
|
|
All the details on the Hack Public Radio website, you can go in the correspondence and find
|
||
|
|
me there.
|
||
|
|
Keep giving me the feedback.
|
||
|
|
Hopefully, this one will be stereo.
|
||
|
|
Apparently, the last one was in mono, so I apologize for that.
|
||
|
|
Thank you very much for listening, and we'll catch you later.
|
||
|
|
Thank you for listening to Hack with OverGradio.
|
||
|
|
HPR is sponsored by Carol.net, so head on over to C-A-R-O-DOT-E-T for all of us in the
|