Questions tagged [hosts]

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

Filter by
Sorted by
Tagged with
19 votes
3 answers
30k views

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's user avatar
13 votes
5 answers
4k views

Permanently store addresses when using SSH

I have a few remote servers which I connect to through the terminal. The servers don't have a domain, only an IP address which is hard to remember when I got a few of them. Is there a way to ...
theusual's user avatar
  • 133
18 votes
3 answers
75k views

ubuntu server not resolving LAN hostnames

Bit stuck here. I have 2 machines that cannot resolve LAN hostsnames, unless there are specific entries in /etc/hosts But other machines on the LAN can resolves hostnames. My LAN: 1 x Cisco ...
teracow's user avatar
  • 283
43 votes
11 answers
177k views

Why is the /etc/hosts file not working?

I have been having problems with this for a while and have tried everything I know, so I figured it was finally time to ask for some help. Any edit I make to /etc/hosts just doesn't work. Example: ...
Julian Fernandes's user avatar
19 votes
3 answers
125k views

How to edit hosts.deny and hosts.allow?

I want to block some hosts in Ubuntu, so how could I edit hosts.deny file to block some hosts like example.com. And one more thing I have installed dnsmasq in Ubuntu, so can I check the entries of ...
codeomnitrix's user avatar
15 votes
7 answers
59k views

/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 ...
Curious Apprentice's user avatar
13 votes
1 answer
29k views

What are the default settings for '/etc/hosts' and '/etc/hostname'?

I'm using Ubuntu 16.04. I recently started learning DevOps and got a bit crazy with my /etc/hosts and /etc/hostname files. In my frantic attempt to spin up a couple of servers from my local machine I ...
user avatar
1 vote
2 answers
8k views

I messed up my /etc/hosts and /etc/resolv.conf files, now my network doesn't work. How can I reset it?

I tweaked my system by installing ftp server and a dns server. I think in the process I messed up resolv.conf and the hosts file. Now I want to restore it but am not able to do so. I am using ...
pritamprasad's user avatar
153 votes
9 answers
382k views

After modifying /etc/hosts which service needs to be restarted?

After modifying /etc/hosts, which service(s) need(s) to be restarted for the change to take effect?
Ashish Karpe's user avatar
  • 2,427
14 votes
0 answers
16k views

sudo: unable to resolve host (name already added to /etc/hosts) [duplicate]

Whenever I use sudo, I get this: sudo: unable to resolve host dave00-G31M-ES2L Here is my /etc/hosts: dave00@dave00-G31M-ES2L:~$ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 dave00-G31M-ES2 # ...
dbalakirev's user avatar
12 votes
5 answers
9k views

Is there a GUI for /etc/hosts that I can use?

I want to be able to easily and frequently edit my hosts file from a quick GUI. Any one know of one that exists? Thanks!
Nicky Hajal's user avatar
4 votes
0 answers
336 views

Hosts file for snap applications

I installed spotify using snap. Now I wanted to change the hosts file to block ads. I used to change the global hosts file and it worked. But then I was installing spotify from the apt repository. I ...
Dines's user avatar
  • 53
4 votes
1 answer
5k views

How can I keep my custom entry in /etc/hosts?

Since I upgraded my laptop to Ubuntu 11.10 32-bit, the entry I add to /etc/hosts for my home server keeps disappearing on boot. I have to edit the hosts file every time I start up and want to access ...
misterhaan's user avatar
4 votes
0 answers
311 views

How do I change hosts file only for a snap app instead of changing my system hosts file?

I see every snap app (in /snap directory) have a etc directory and some of them have a hosts file. Can I change it to prevent snap app connect to an address?
Vân Phong Nguyễn's user avatar
1 vote
0 answers
826 views

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 ...
Kostas Mouratidis's user avatar
1 vote
1 answer
828 views

How to route DNS resolver to a different DNS based on the URL hostname?

This is why I would like to do: Most hostnames -> Resolved by DNS1. Some hostnames -> Resolved by DNS2 (I don't know IP addresses just the hostname). It should look as creating a whitelist/...
denik1981's user avatar
  • 123
1 vote
3 answers
13k views

Is /etc/resolv.conf a symbolic link, and are changes to it persistent?

Is /etc/resolv.conf a symbolic link? If so, how can one make persistent changes to the DNS?
yoyo_fun's user avatar
  • 181
1 vote
1 answer
333 views

What is the difference between hosts and hosts.deny?

The question might seem trivial but for the last 36 months I have lived in the illusion that what I put in the hosts.deny file will stop my computer from visiting those sits. But some sites have still ...
no mouse's user avatar
  • 115
0 votes
2 answers
227 views

Host and fstab file messed up after try to change swap size

I was trying to increase the swap size of my Ubuntu. I, naïve, followed the steps of this answer: Check the swap that is in use: sudo swapon -s If swap partition(s) are found: sudo swapoff -a sudo ...
Simón's user avatar
  • 11
0 votes
1 answer
1k views

Modify Hosts File [closed]

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 ...
user308751's user avatar