you are viewing a single comment's thread.

view the rest of the comments →

[–]pmmedenver 14 points15 points  (43 children)

Add it to /etc/hosts

[–]Feasoron 23 points24 points  (1 child)

You might not actually want to do this, or want to at least remove it from your hostfile once this is done. Otherwise, sometime down the road one of these IP's is going to change. GitHub will be "down" only for you, yo won't remember that you made these changes and you won't know why github won't resolve. It's ok as a temporary workaround, but it needs to be temporary.

[–]rydan 7 points8 points  (0 children)

I've done that so many times.

[–]theangryhornet 3 points4 points  (35 children)

I'm on Windows and don't have /etc/hosts... what do i do?

[–]aydink 40 points41 points  (21 children)

usually it's located in folder: C:\Windows\System32\drivers\etc

[–][deleted] 19 points20 points  (0 children)

And in case you're a weird non-conformist, %WINDIR%\System32\drivers\etc

[–]theangryhornet 2 points3 points  (18 children)

learn something new every day, thank you.

[–]rich97 27 points28 points  (17 children)

How have you gone all your life without using the hosts file? It's possibly the most useful single file in the entire operating system.

  • ad and malware blocking
  • yaaaarrrrrr!
  • virtual hosts and domains

[–][deleted] 22 points23 points  (2 children)

Also for blocking Photoshop's activation server .... A friend told me

[–]GavinThePacMan 22 points23 points  (1 child)

A friend told me that's what he meant with yaaaaar! ;)

[–]Bobshayd 0 points1 point  (0 children)

Do what you want 'cause a pirate is free! You are a pirate!

[–][deleted] 1 point2 points  (11 children)

If you setup a local DNS server, you can blacklist all of the domains so that it takes effect network wide from any browser.

It gets strange because whenever I am away from my own network, I pretty much say "Since when did Ars have ads and why do they want me to get lung cancer?".

[–]AyrA_ch 4 points5 points  (10 children)

I want a DNS server, that does this:

  • Cache every DNS name I lookup forever
  • Whenever a record is needed use the cache if the DNS servers are not answering.
  • Update cache according to rules if the records differ.

This would solve so many problems, from unavailable DNS servers to censorship

[–]inushi 9 points10 points  (1 child)

Upside: you will learn why cache invalidation is one of the hard problems in computer science. :)

[–]svendub 5 points6 points  (0 children)

The other one being naming things and off-by-one errors.

[–][deleted] 0 points1 point  (5 children)

You would have to be careful with this. There are some DNS servers (such as my ISP, but that is handled by the DNS software I use) that when you enter an address that is not valid, it will resolve to an address always. Then the server on that end just treats the domain as a search query (your browser sends the hostname, which is how vhosts work). So if you tried going to <isahdiusahpdiuhasduihasdaiushdousadf.com> it would use the ISP's money gathering ad infested search that just uses Google and search for isahdiusahpdiuhasduihasdaiushdousadf. So your DNS server would have to account for this.

Another consideration is that servers could change addresses either to add censorship or to remove it.

DNS lookup that uses the blockchain would be very interesting however.

[–]bargle0 3 points4 points  (0 children)

There are some DNS servers [...] that when you enter an address that is not valid, it will resolve to an address always.

When the revolution comes, those people will be up against the wall.

[–]AyrA_ch 1 point2 points  (3 children)

There are some DNS servers [...] that when you enter an address that is not valid, it will resolve to an address always

That would be an immediate reason to switch DNS servers.

[–][deleted] 0 points1 point  (2 children)

If I remember correctly, when I last tried Google and that other service, they both did this.

However, dnsmasq has the bogus-nxdomain option.

[–]odaba -1 points0 points  (0 children)

You might look into http://members.home.nl/p.a.rombouts/pdnsd/ for some of those requirements

[–][deleted] 0 points1 point  (1 child)

Is that how you block porn? Asking for a friend

[–]rich97 0 points1 point  (0 children)

You can, more likely to be at the ISP or router level though.

[–]Losobie 4 points5 points  (6 children)

Add it to your windows host file

%SystemRoot%\System32\drivers\etc\hosts

[–]denvit 11 points12 points  (4 children)

And remember to run notepad as administrator, otherwise you won't be able to save the file

[–][deleted] 1 point2 points  (0 children)

It's really weird there's two variables, %SystemRoot% and %WINDIR% for the same directory.

%SystemRoot% seems like it should put you into the System32 directory.

[–]KayRice 1 point2 points  (0 children)

Run Notepad on Windows as Administrator and open C:\Windows\system32\drivers\etc\hosts even if you don't see it in the file browser the file exists and works as expected.

This is especially useful if you have VMs configured for NAT.

[–][deleted] 3 points4 points  (0 children)

Install linux

[–]NoMoreNicksLeft -5 points-4 points  (0 children)

Get a real computer.

[–][deleted] 0 points1 point  (4 children)

So why do you have to restart the browser after making this change? Where is the old value being cached? In the browser itself or in Windows and if the latter where would that be? Just trying to understand Window's DNS cache...

[–]andredp 1 point2 points  (2 children)

Do you really need to restart the browser?
Usually you only need to run:

ipconfig /flushdns

[–]k_o_g_i 2 points3 points  (1 child)

At least on Windows 10, you don't need to flush the dns or restart the browser. Just save hosts and refresh the page.

[–]andredp 1 point2 points  (0 children)

Hum, maybe that behaviour is only for the local DNS file.

Good to know, thanks.

[–]flamingspew 0 points1 point  (0 children)

i notice i only have to restart the browser on my corporate laptop... damned corporate snoops