Questions tagged [hosts]

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

Filter by
Sorted by
Tagged with
153 votes
9 answers
377k 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
42 votes
11 answers
175k 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
30 votes
3 answers
95k views

Why is my /etc/hosts file not queried when nslookup tries to resolve an address?

I have a couple of local domains resolved to 127.0.0.1 in my /etc/hosts file. And it was all alright for a period of time but now when I run: nslookup test.local It results in: Server: 192.168....
Mehran's user avatar
  • 1,787
26 votes
3 answers
73k views

Changing System name [duplicate]

I am given an old Ubuntu working system and the previous user had everything on his name so started turning it to my name as typing his name everywhere was bugging me. I tried: $ usermod -l hussain ...
Hussain Nagri'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
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
18 votes
6 answers
56k views

How to SCP a file from Mac -> Ubuntu VirtualBox?

I have a Mac (OS X) and a VirtualBox running Ubuntu. I want to SCP a 500mb file from the Mac to the VirtualBox. How do I do this? (Probably something to do with /etc/hosts?)
coffee-grinder's user avatar
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
18 votes
1 answer
70k views

Why does my name resolution hit the DNS even with a hosts file entry?

I'm running Ubuntu 10.04.2 LTS Desktop. Being a web developer, naturally I created a "me.com" in my /etc/hosts file. Unfortunately, my name resolution is going out to the DNS before first checking my ...
Volomike's user avatar
  • 2,283
16 votes
2 answers
8k views

/etc/hosts not working

I populated /etc/hosts with device names and IP addresses. For example: chassisOne 10.0.0.1 chassisTwo 10.0.0.2 . . . etcetera. I am able to ping the IP address of both chassisOne and ...
Dale Smith'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
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
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
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
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
11 votes
2 answers
28k views

Cannot access local server with IP address while localhost and 127.0.0.1 can

I am trying to let other computers to access my local server but I tried myself locally that I cannot access it locally even myself. Several things you should know: My target Visit my server via ...
Hearen's user avatar
  • 253
11 votes
2 answers
32k views

Use /etc/hosts to direct wildcard domain name

I searched this term and didn't find my answer: "wildcard domain name in hosts" I have a HostGator account where I create secret domains so I can build and test websites. In order to use them, I add ...
Buck's user avatar
  • 720
11 votes
1 answer
12k views

Default permission of hosts file

I changed the permissions of my host file /etc/hosts by doing a chmod og+w. What's the default permission so that I can switch it back?
Ashfame's user avatar
  • 3,214
11 votes
1 answer
7k views

How to set up localhost to redirect a website

I am asking this question from an awkward situation. As you may know or not know, Google is blocked in China. A discouraging consequence (at least to me) is that visiting Stack Exchange sites, like ...
Zheyuan Li's user avatar
10 votes
1 answer
4k views

extension for /etc/hosts

Is it possible to extend the file /etc/hosts on ubuntu16.04? I have many ubuntu-servers, all servers should use the same /etc/hosts file, except some special entries. My preffered solution would be ...
Christian M's user avatar
9 votes
4 answers
33k views

What would cause 'ping localhost' to fail?

the /etc/hosts file contains a line: 127.0.0.1 localhost so localhost should be a valid hostname, but any attempt to connect to a port on localhost fails, including ping. Connection attempts into ...
user avatar
8 votes
2 answers
22k views

Network configuration: resolv.conf and hosts

I read This manual and I'm a little confused. This is what I don't undetstand: When your system tries to resolve a hostname to an IP address or determine the ostname for an IP address, it refers to ...
yotamoo's user avatar
  • 4,229
8 votes
1 answer
8k views

Is it possible for /etc/hosts to include a file from my home directory?

I would like to setup Ubuntu One to sync a hosts file in my home directory between my machines. Ideally I would setup all my local web development URLs there and it would just sync between devices. ...
Ben's user avatar
  • 1,016
7 votes
4 answers
13k views

"Lock" one specific file so that I nor root no longer have access to it any more

To combat procrastination, I edit my /etc/hosts file by adding time-wasting websites and pointing them to localhost. However, the flesh is weak and I often find myself reverting my changes. I was ...
BioGeek's user avatar
  • 401
7 votes
2 answers
15k views

create an alias for `localhost:8080/` as `www.my-domain.com/`

In ubuntu, I want to create an alias for localhost:8080/ as www.my-domain.com/. So that whenever I type www.my-domain.com/ in URL field, it shows up from localhost:8080/. What is the easiest way to ...
Rajat Gupta's user avatar
7 votes
2 answers
32k views

'/etc/hosts' , http links are redirecting, but https links are not redirecting

I edited /etc/hosts file and entered below information : 127.0.0.1 test.com //working 127.0.0.1 https://test.com //not working . from the above info, http://test.com is redirecting to 127....
user avatar
7 votes
3 answers
11k views

Ubuntu 18.04 not recognizing hostnames from router

I previously had Xubuntu 16.04 installed, and it did recognize the hostnames set by my router (Tomato). For example, I have a computer with the name mate on the network with a static IP of 192.168.2....
Sarke's user avatar
  • 341
7 votes
1 answer
3k views

network IP addresses monitor widget

Is there a widget that shows all current hosts (IP adresses) in a list? I am not talking about a network bandwidth meter widget.
oxxo's user avatar
  • 71
6 votes
2 answers
7k views

I want to change the host name - is it enough to edit the /etc/hosts file? [duplicate]

Short version Can I just edit the /etc/hosts file, meaning can I login as user@<hostname I wish to change> without unintentionally breaking something? Would this be enough or is there something ...
hello_there_andy's user avatar
6 votes
1 answer
45k views

SSH: How to handle missing: /home/USER/.ssh/known_hosts [closed]

I have a old laptop that I'm using to learn Ubuntu Server 12.10. Prior to reformatting and installing Ubuntu Server, Ubuntu Desktop was used. With Ubuntu Desktop, I was using a no-ip.com hosted ...
jerrycrabb's user avatar
6 votes
1 answer
502 views

Torque: Unauthorized Request

Following this guide: https://jabriffa.wordpress.com/2015/02/11/installing-torquepbs-job-scheduler-on-ubuntu-14-04-lts/ I installed TORQUE on Ubuntu 16-04-lts (he claims the process works the same ...
MrSynAckSter's user avatar
5 votes
1 answer
8k views

Rename computer in Ubuntu 13.04

How can I rename my computer? Renaming it in /etc/hosts and /etc/hostname does something weird. Before renaming it, I am able to open these files via sublime using sudo subl /etc/hosts but when I ...
Sourabh's user avatar
  • 1,761
5 votes
2 answers
19k views

editing apache vhosts and ubuntu hosts file?

I have just installed ubuntu (11.04). I have installed apache/mysql/php etc. I have a few sites sitting in /var/www/site1 /var/www/site2 /var/www/site3 I want to be able to access these at ...
Hailwood's user avatar
  • 4,957
5 votes
1 answer
25k views

Missing /etc/hosts file – How can I create a new hosts file? [duplicate]

I have googled and searched Ask Ubuntu on this, but got no relevant answers. I have no hosts file in /etc, I cannot find a hosts file in search, I am talking about the system hosts file not lampp/etc. ...
kerry's user avatar
  • 301
5 votes
1 answer
48k views

curl --resolve option not working: "Hostname was NOT found in DNS cache"

I am attempting to use curl's --resolve option to connect to the specified IP address when performing the HTTP request, but curl keeps reverting back to the IP address as retrieved by my local DNS ...
iglvzx's user avatar
  • 626
5 votes
2 answers
18k views

Configure hosts file to use aliases

I am running Ubuntu Desktop 12.04 and would like to be able to open a web browser (Firefox), type an alias into the address bar, hit enter, and have the browser take me to the site that the alias ...
zharvey's user avatar
  • 1,785
5 votes
1 answer
218 views

Preventing Users/Groups from accessing certain Domains

I have created a Study account which I use when doing anything school related work. It's purpose is to remove the distractions of my normal account, such as social media and news websites. I know /...
ncphillips's user avatar
5 votes
1 answer
8k views

VirtualHost In Localhost Is Not Accessible From Localhost When Offline, How To Fix It?

I am setting up my own local development web server, mainly for theme development. I've successfully setup LAMP in Ubuntu 13.04 64bit Desktop, apache works fine. The machine where LAMP is installed ...
GaryP's user avatar
  • 178
5 votes
1 answer
1k views

How would I broadcast a subdomain/virtual name on a local server with people connected to the same network

I have a server connected to the router which has ubuntu 12.04. It is has apache/mysql/php all installed ready to go. the folder structure is like this: /var/www -- this isnt the root -/libs -/logs -/...
Exploit's user avatar
  • 223
4 votes
1 answer
13k views

/etc/hosts file not being used before DNS server query

I have upgraded to Ubuntu 12.10 and I have made entries in /etc/hosts, but instead of looking into the hosts file, queries to my configured DNS server are being made first. How can I make Ubuntu ...
Baldrick's user avatar
  • 635
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
2 answers
321 views

How can I prevent Desktop Users from accessing any online website?

How can I prevent Desktop Users from accessing any online website? I tried 127.0.0.1 * in /etc/hosts but it didn't do the trick. Please note that I need to keep http://localhost fully functional. ...
emurad's user avatar
  • 211
4 votes
1 answer
241 views

Why is this single-word address being resolved? [closed]

I'm running Ubuntu 12.04. On my work network, there's a single-word address (let's call it foobar) that is responding to pings and HTTP requests, only from my machine. The address is not a TLD, just a ...
That Brazilian Guy's user avatar
4 votes
1 answer
17k views

How to redirect a URL to another URL using /etc/hosts

I want to block some sites on my ubuntu system.So, I added some lines to the /etc/hosts, which are 127.0.1.1 www.reddit.com 127.0.1.1 www.facebook.com This now successfully blocks the ...
Heisenberg's user avatar
  • 1,626
4 votes
4 answers
15k views

Apache - server not resolving by /etc/hosts if I have not internet connection

I have configured many virtualhosts in my current apache2 server, in my local machine (Ubuntu 13.10). Those are different local sites, with domains which are set in my /etc/hosts: 127.0.0.1 ...
Luis Masuelli's user avatar
4 votes
2 answers
7k views

How to temporarily override a DNS setting for a certain domain name to point to localhost?

I need ubuntu to use a certain domain name to point to a localhost address temporarily. How could I confgure for that ?
Rajat Gupta's user avatar
4 votes
0 answers
330 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
0 answers
310 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
3 votes
1 answer
11k views

unable to edit /etc/hosts file in ubuntu 14.10

I changed the hostname from default name, set during installation to something short and nice, but didn't change it in /etc/hosts file. /etc/hostname is changed after restart but sudo is not working. ...
Rookie's user avatar
  • 33
3 votes
3 answers
23k views

How to add entry to /etc/hosts with a built-in command line

It turns out that editing /etc/hosts is enough to add an entry of DNS. Is there a built-in cmd , where we can: add host cmd: $ sudo mycmd 10.103.23.34 myme.com Result : 10.103.23.34 ...
Abdennour TOUMI's user avatar

1
2 3 4 5