Questions tagged [hosts]

An /etc/ file that lists the hosts on a network (/etc/hosts ).

The file; /etc/hosts

Static hostnames are locally defined hostname-to-IP mappings located in this file, and takes precedence over DNS.

related files;

  1. /etc/hosts.allow
  2. /etc/hosts.deny
  3. /etc/resolve.conf (the local dns file)

Recommended reading; https://help.ubuntu.com/10.04/serverguide/C/network-configuration.html - near the bottom, under Name Resolution

205 questions
19
votes
3 answers

how to block specific domains in hosts file?

I know hot to block single tumblr blog with 127.0.1.1 something.tumblr.com but I want to block entire tumblr. I tried 127.0.1.1 tumblr.com but it's not working. Is there a way to do this?
user1079002
  • 447
  • 1
  • 5
  • 13
15
votes
7 answers

/etc/hosts modification does not work properly. What to do?

I have added these lines to the hosts file: 127.0.0.1 localhost adobe.com 127.0.0.1 adobe.com It works perfectly on windows. But in Ubuntu 11.10 when I try to access it using Firefox the website is opening. Google chrome though supporting…
3
votes
0 answers

Blocking youtube on Ubuntu using etc/hosts

I want to block Youtube using the hosts file. I managed to do this with Facebook and Instagram but with Youtube it is not working. Here is my hosts file: 127.0.0.1 localhost 127.0.1.1 goncalo-X541UV #The following lines are desirable for IPv6…
3
votes
1 answer

14.04 /etc/hosts ignored

I have added a line like the following to my /etc/hosts file: 159.253.x.xxx www.***.nl When I ping to www.***.nl it gives me the correct ip address back but when I use my browser I do not get to 159.253.x.xxx (which is my development server…
Bernhard
  • 203
2
votes
1 answer

Hosts file change syntax

I am attempting to migrate a website to a ubuntu server but would like to test it first On windows I have changed my host file to point to the server, so the browser is opening the "new" site. In my terminal , in Ubuntu I have changed the…
Adrian
  • 243
2
votes
1 answer

/etc/hosts keeps getting reset. How am I supposed to edit it?

Whenever I edit my /etc/hosts file it's not long before I find it is exactly what it was before I edited it. Is there some master file I should be editing, or a gui interface I'm supposed to be using to edit it? I'm still on Natty.
1
vote
3 answers

Hosts file with port?

I know you can't put a port in /etc/hosts, so how can I achieve the equivalent of: 127.0.0.1 https://website.com:4433 For WordPress, I need CURL to go to 127.0.0.1 on port 4433. As it's wordpress and not a script I made, I can't change that.
user8292439
  • 3,808
1
vote
1 answer

/etc/hosts Problem

cat /etc/hosts returns two results: 127.0.0.1 Localhost 127.0.1.1 [mycomputersname].[city].[state].[domain].net (brackets for anonymity) When I run hostname, it returns [mycomputersname] without the .*.* etc etc Whenever I run sudo, it tells…
ztpsec
  • 11
  • 1
1
vote
1 answer

Hosts file changes not showing their effect, other options?

Hosts file changes not showing their effect. I need to add a domain name alias to my localhost address so that when I type "myfictiousdomainname.com" it should request localhost:8084 address on my computer. But I made all attempts to make the…
1
vote
1 answer

Would there be a problem if I set 2 hostnames in my server?

Would there be a problem if I set 2 hostnames in my server? vi /etc/hostname dns01.hello.com proxy01.hello.com and in my hosts file 127.0.0.1 localhost 127.0.1.1 dns01.hello.com 127.0.1.1 proxy01.hello.com Cause I will run a proxy and bind…
erlchamp
  • 41
  • 1
  • 5
1
vote
1 answer

Adding block list to hosts file

Ubuntu 21.04. Linux newbie here. For a few months I’ve been thinking about setting up a pi-hole to block ads. But a few days ago I read about just adding a block list to the hosts file. I wasn’t aware of this option. It sounds a lot easier than…
Advait
  • 505
  • 2
  • 7
  • 14
1
vote
0 answers

How to resolve captchas whilst blocking google.com on Ubuntu 20.04?

Question How could one solve captchas, such as those shown by zoom when one would like to join a meeting from the browser, whilst blocking access to www.google.com (search queries) on Ubuntu 20.04? Constraints Blocking google.com has to be…
a.t.
  • 317
1
vote
0 answers

Resetting $HOST after some other command modified it

Anaconda incorrectly overwrites the $HOST variable which seems to be caused by this anaconda bug. It exports x86_64-conda_cos6-linux-gnu as the HOST. This probably occurs only when ran inside .bashrc to initialize the terminal. Simply exporting…
0
votes
1 answer

Modify Hosts File

Has anyone used this method: http://www.putorius.net/2012/01/block-unwanted-advertisements-on.html I tried per instructions. Maybe I'm too new to Linux, it's not working for me. While looking for etc/hosts I came across hosts.allow and hosts.deny.…
-1
votes
1 answer

How do I edit hosts files? Lubuntu 20.04

Normally I get a access denied even after I change it's permission to 777. I see many solutions Use gedit, dunno how to get use or find whatever that is. Other solutions use the terminal sudo -i gedit /etc/hosts Sure but I don't know how to save a…