Skip to main content

Questions tagged [hosts]

/etc/hosts is the configuration file with locally known mappings between domain name and ip address.

48 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
4k views

IPv6 link-local address in /etc/hosts

I have an entry like this in /etc/hosts: fe80::XXXX:XXff:feXX:XXXX%enp0s25 test-ipv6 This is a link-local address. I've masked out my MAC address (with the 7th most significant bit flipped) for this ...
Manuel Jacob's user avatar
5 votes
2 answers
568 views

What application can I use to block hosts with regex?

Is there any tool/application that I can use to block hosts from all forms of connection from my computer? Currently I use /etc/hosts and place the absolute host like this: 127.0.0.1 unix....
DisplayName's user avatar
  • 11.7k
4 votes
0 answers
1k views

Make ping show hostnames instead of IPv6 addresses

When I use the command ping ff02::1%eth0 to get a response from all IPv6 hosts in the network segment, I get responses from a bunch of link-local (fe80::) addresses (LLIPs). In order to figure out ...
Malvineous's user avatar
  • 6,943
3 votes
1 answer
1k views

Can I use /etc/hosts to whitelist domains?

I set up a little ubuntu box for my son for remote learning and I would like him to only access certain domains in the browser. I was thinking of doing a blanket etc/hosts but I would need to add ...
Frank Conry's user avatar
3 votes
0 answers
227 views

Unblocking websites using /etc/hosts

I cannot unblock certain websites that were previously blocked from /etc/hosts. Here is what the file looks like: 0.0.0.0 facebook.com :: facebook.com 0.0.0.0 youtube.com :: youtube.com When I ...
Neil Devas's user avatar
3 votes
0 answers
310 views

Hosts file no longer ignoring midline comments

I've just upgraded from ubuntu 16.04 to 18.04 My /etc/hosts file has a number of lines in the form: 1.1.1.1 domain1.net domain2.net # domain3.net domain4.net (In other words, I had originally ...
Chris's user avatar
  • 31
3 votes
0 answers
504 views

Absolute domain names in /etc/hosts?

I have a RHEL7.0 host which has this standard entry in /etc/hosts/: 127.0.0.1 localhost.localdomain localhost So resolving localhost.localdomain works: $ ping localhost.localdomain PING localhost....
John Dough's user avatar
2 votes
0 answers
1k views

How to synchronizing /etc/hosts files across multiple linux machines

I have 20 linux servers that use /etc/hosts files to see and talk with each other. I'm adding servers to this pool of servers. It is required to do host resolution via the /etc/hosts files. DNS or NIS ...
Cell-o's user avatar
  • 505
2 votes
0 answers
165 views

The correct way of implementing adblocking with uzbl?

I though about running some proxy on localhost, but will I be able to filter https? I've tried to use scripts from wiki, but they are not seem to work. Another idea is to implement adblocking using /...
Moonwalker's user avatar
2 votes
0 answers
593 views

DNS works half of the time in Oracle VirtualBox and I can't even maintain /etc/hosts file

I have installed three Linuxes on same laptop and same VirtualBox and this is my success ratio with DNS: HortonWorks & CentOS. Worked for 5 minutes and never after that again. VM image ...
Timo Riikonen's user avatar
2 votes
0 answers
2k views

Why is my /etc/hosts.deny file being ignored?

I am using a small embedded linux setup generated by buildroot to run on a x86 device. It was generated to use busybox init system and also runs dropbear so I can ssh into the device. I wanted to ...
mathematician1975's user avatar
2 votes
0 answers
238 views

why is FQDN using external IP address

When postfix connects to the FQDN dur.bounceme.net it uses the external IP address: root@dur:~# root@dur:~# tail /var/log/mail.log Aug 28 04:39:45 dur postfix/master[6667]: terminating on signal 15 ...
Thufir's user avatar
  • 1,910
1 vote
1 answer
41 views

zsh completion for cssh: complete hosts from /etc/hosts as well as ~/.ssh/config

my zsh completion file _cssh has this line, which completes hosts only from /etc/hosts: '*:userhostport: _alternative hosts:host:_hosts usersathosts:userathost:_user_at_host' how do I make it ...
Martin Vegter's user avatar
1 vote
0 answers
901 views

sudo: unable to resolve host debian: Name or service not known. I've already set host name in /etc/hostname and /etc/hosts but it keeps changing?

Hello Linux community. I have a VPS service bought from Vultr, so this is not some home standalone PC with Linux installed on it. I have to deal with all this obscure Control Panel setup they "...
michal roesler's user avatar
1 vote
2 answers
381 views

cache /etc/hosts and /etc/resolve.conf forever

I'm looking for a way to cache the hosts file, the resolv.conf file and new DNS entries and the closest thing that doesn't quite work is nscd. Nscd will happily cache DNS requests that are present in ...
mike_s's user avatar
  • 11
1 vote
0 answers
133 views

How to block or whitelist specific webpages or files within a domain but block most of the domain?

I know how to use /etc/hosts to redirect www.herpaderp.com to 0.0.0.0 The problem is I need one page file from the website on a regular basis. I want to whitelist www.herpaderp.com/dir/foo.bar while ...
Max Power's user avatar
  • 264
1 vote
1 answer
713 views

cannot access github.com

I cannot nslookup github: nslookup github 8.8.8.8 ;; connection timed out; no servers could be reached nslookup github.com ;; connection timed out; no servers could be reached nb: default ns server =...
achille's user avatar
  • 203
1 vote
0 answers
41 views

Is it possible to configure /etc/hosts on a per network basis?

I have a server at home with a domain name (let's call it domain.name). On my laptop, I have added this line to /etc/hosts: 192.168.1.7 domain.name At home, this is great, but at others places this ...
Melchisedech's user avatar
1 vote
1 answer
528 views

Block all websites except Kahn academy

I am trying to set up a ubuntu user so that they can access the Kahnacademy instructional website, but not anything else. In particular, I want to block youtube. There are instructions here but I ...
Manu's user avatar
  • 131
1 vote
0 answers
29 views

Create custom page for lock

I'm new to DD-WRT v3.0-r39469 std (04/10/19) so I have several questions! I want to make a custom LOCKING PAGE in the domain 127.0.0.2 in my network, is it possible? I ran the page to which I wanted ...
user346425's user avatar
1 vote
0 answers
144 views

sm-notify: bindresvport on RPC socket failed: Cannot assign requested address

Can't figure out how to make sm-notify work. I've added hostname entry with related IPv4 to /etc/hosts $ cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ...
Samuel's user avatar
  • 203
1 vote
0 answers
63 views

Remote not using hosts file from server

I am using a hosts file on an Ubuntu Server where is written all the pairs IP domain names. The remote computers (all of them with Windows OS) are connected to the server on the same network and they ...
Idhrenniel's user avatar
1 vote
0 answers
1k views

hostname not showing in who command output with RHEL 7.4 after editing in /etc/hosts file

On Redhat 7.4(maipo) server I am seeing issues as below. Prior to RHEL 7.4 let say RHEL 7.3 if I login to server though putty using my local IP 192.168.187.1 and execute who command it was showing ...
Rakesh P's user avatar
1 vote
1 answer
567 views

Resolve urls within the server

My problem is urls within my PHP scripts are not resolving correctly. Ie, the domain name I am using in a PHP script doesn't resolve back to the server when accessed from within the server. For ...
sazr's user avatar
  • 241
1 vote
1 answer
93 views

How did my Hosts file change?

Let me start this by saying I do not or never have had Admin access to my Mac. Issue: Recently when I tried to navigate to the URL dev.local.com which was mapped to a specific IP address in my Hosts ...
Denoteone's user avatar
  • 111
1 vote
2 answers
675 views

bash completion: how to complete a list of hosts for a specific argument?

My programm can have the following format: <command_name> <arguments> <options> -hosts <host1> <host2> ... <hostn> (<more_arguments>) ... I am trying to set ...
denaitre's user avatar
0 votes
0 answers
38 views

how to add multiple interfaces in `/etc/hosts.allow` file?

SSH is listening on all the available 10 Ethernet interfaces in my system. I have tested using nc 160.49.198.97 22 command in Linux. To allow only particular interface and block others, i have created ...
Karma Yogi's user avatar
0 votes
0 answers
21 views

Passing last IP octet to a host alias and have it added to complete full proxycommand with ip address

I wish to have this all done in the ssh config file for a specific user. The site has hard-coded ip addresses into there various software and using the naming convention is not really an option. Host ...
Chaos's user avatar
  • 1
0 votes
0 answers
60 views

Ubuntu: Broadcast CNAMES/Alias to the router/ DHCP server/ DNS server

I am trying to build a portable home server with a Intel NUC. My requirement is to plug my NUC to any of my friends or relatives router and with minimal configuration, preferably no configuration, be ...
Aditya Kumar's user avatar
0 votes
0 answers
2k views

Unable to resolve DNS names that are mentioned in the /etc/hosts file

I am running RHEL8 and running into a very weird issue. I have host entries in my /etc/hosts file, but when I go to ping them, I am getting name resolution errors. Here's an example of my /etc/hosts ...
user3447014's user avatar
0 votes
1 answer
87 views

How do I get the inside of the network to see the server properly? Inside the network, foobar.net doesn't resolve

I'm running MINT 20.1. I am connected to the net via AT&T UVERSE fiber optic. I have a DNS, foobar.net, set up to point at my router, and when I am outside the network, I can load a website ...
Richard Hasting's user avatar
0 votes
0 answers
52 views

Why is the IP address lookup in /etc/hosts only sometimes work?

The '/etc/hosts' file in a Linux laptop (with LAN IP 172.17.37.21) by default contains : 127.0.1.1 Acer-Aspire-6930G When I want to reach this laptop wirelessly from a smartphone or a PC using an FTP ...
Petoetje59's user avatar
0 votes
1 answer
954 views

Is there a distro specific to the LAMP stack?

I tried real hard to get LAMP stack working on my pop_os home pc, but could not get it working. Is there a distro in existence with the LAMP stack preinstalled which I can just add WordPress on top of....
Neil Meyer's user avatar
0 votes
0 answers
114 views

Apache2: Hosting Multiple Sites (Ubuntu Server)

I am new working with system.d and services on ubuntu/debian. I'm trying to serve multiple sites on the same Apache2 (I am note sure if I should have 3 apache2 folders for the each service). The ...
Wiimortal's user avatar
0 votes
0 answers
462 views

mDNS instead of IP in /etc/hosts?

I have a laptop that I want to communicate with from my other PC. Sometimes I need to connect with this laptop for various tasks (ssh, scp, ping, to reach some locally hosted website, etc. - dev stuff ...
mnj's user avatar
  • 291
0 votes
1 answer
625 views

What to do when you can't edit /etc/hosts

I need to override DNS for a few hostnames on a Linux Centos 7 machine. I do not have write access to the file, however. What can I do in this case?
JoshK's user avatar
  • 109
0 votes
0 answers
480 views

Usage details of ahostsv4 in linux

There is a term called ahostsv4 in the Linux documentation of man getent. What is the usage of it?
Rumado's user avatar
  • 101
0 votes
0 answers
205 views

DNS adblocking ignored on connected clients with Internet access provided over WiFi in 'Client' mode

2019-04-19: I've come to the conclusion this might be some setting or bug in dnsmasq as logs shows config error is REFUSED. I will update this question at sometime in the future after I've analyzed ...
Daniel Sokolowski's user avatar
0 votes
0 answers
200 views

dnsmasq has no effect on router itself

here is my resolv.conf nameserver 127.0.0.1 nameserver isp_provided Here is my dnsmasq.conf, which will do DHCP also: user=nobody bind-dynamic interface=br0 interface=ppp1* no-dhcp-interface=ppp1* ...
Wang's user avatar
  • 1,316
0 votes
1 answer
226 views

connection to multiple switches from /etc/hosts and export multiple commands output to file

Actually I'm concerning how to log multiple switches listed from /etc/hosts and run on each few commands and store the output to one log file on main linux host. Second question may ask how to connect ...
Mac's user avatar
  • 53
0 votes
1 answer
324 views

hostname -f .com.com

I modified my /etc/hostname file and /etc/hosts like that: hostname.com and 127.0.0.1 localhost.localdomain localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-...
RainbowPeach's user avatar
0 votes
1 answer
2k views

Browse by hostname from internet browser

I can browse my server site using ip:8080 which is inside my home network.But I am not able to browse using hostname:8080 I do not have dns server. I have edited /etc/hosts file to include ...
kinkajou's user avatar
  • 735
0 votes
1 answer
2k views

Make user made entries in /etc/hosts permanent

I use Juniper Networks network connect to connect to the office network. Once i am inside the office network, i check the server ips and add entries for them in /etc/hosts file like, 10.199.xx.yy ...
user avatar
0 votes
2 answers
773 views

CentOS 6.5 hostname on VPS

I'm trying to change the hostname on my fresh CentOS 6.5 image (VPS) via SSH. The sources I've found all say the hostname can be permanently changed in /etc/sysconfig/network and /etc/hosts, and that ...
vaindil's user avatar
  • 301
0 votes
1 answer
741 views

Resolve Host's IP on VM

I have kind of tricky situation. I have monitoring tool where all my hosts and their VM's (with IP's and so on) are listed. But what I need is to resolve on which host(need it's ip or hostname) this ...
Dambre's user avatar
  • 1
0 votes
0 answers
69 views

VirtualHost configuration not working

I followed this article, mixed with some other research, in an effort to get VirtualHost configuration up and running on my Mac. However, for some reason when I navigate to my local.site.rocks URL it ...
Mike Perrenoud's user avatar
0 votes
1 answer
505 views

How do I assign a hostname to a dynamic IP address assigned by DHCP?

On my home network, the IPv4 address changes regularly, probably because when my computer got turned off, another computer was assigned to the same address so when I started my computer, there was an ...
Jonathan Dahlin's user avatar
-1 votes
1 answer
87 views

Can browse to an app at localhost.company.com but that isn't in /etc/hosts; where else could the redirection be?

✗ cat /etc/hosts ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 ...
jcollum's user avatar
  • 1,189