Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [hosts]

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

-1
votes
2answers
45 views

Variable for SCP command in script

I'm trying to write a script that will check what is the last modified/created file on the server, then copy it to my homedirectory on this server and then copy this file from node to my local machine....
-1
votes
1answer
33 views

is there any advantage to use dns server instead of dns that based on /etc/hosts

we have two option to use DNS in our presto cluster use /etc/hosts and set all aliases in hosts files use DNS server ( WIN 2008 server ) , and configure /etc/resolve.conf the first option is more ...
1
vote
1answer
75 views

How to ignore hosts file? [closed]

I need to know if there is a web browser using its own "hosts" file or simply ignoring the "hosts" file from OS. UPDATE 1: This is the situation: certain program requires certain URL for validation :...
0
votes
1answer
37 views

comparison of two sorted files by common first field

I have to compare the IPs of two different /etc/hosts files and show a diff in side-by-side view. File hosts_sorted 10.244.74.152 REF_UP-4 10.244.74.154 REF_UP-5 10.244.74.156 REF_UP-6 10.244....
0
votes
0answers
59 views

add per-client 'hosts' file for DNS clients on router

so I want to block some hosts (iOS telemetry sites specifically) for specific clients on my router. Router runs asuswrt merlin fw, so it has dnsmasq and dnscrypt-proxy installed. Ideally I want ...
1
vote
0answers
17 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 ...
0
votes
0answers
26 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?
1
vote
0answers
24 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 ...
1
vote
0answers
23 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 ...
0
votes
0answers
53 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 ...
10
votes
3answers
2k views

How do `/etc/hosts` and DNS work together to resolve hostnames to IP addresses?

In Linux, how do /etc/hosts and DNS work together to resolve hostnames to IP addresses? if a hostname can be resolved in /etc/hosts, does DNS apply after /etc/hosts to resolve the hostname or treat ...
-1
votes
1answer
69 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 ...
1
vote
1answer
277 views

Understanding why hostname -i returns strange IP address

I am referencing the following question because it's similar but not the same: hostname -i returns strange result in linux On my CentOS 7 system, I get a strange IP address from "hostname -i" after ...
0
votes
1answer
50 views

/etc/hosts file is cluttered with useless content, how should I properly use /etc/hosts ( apache2 )

I recently tried to add a URL in my /etc/hosts file, and because of many different attempts in the past, I realized I most probably have some extra lines in there which are not necessary. I have read ...
1
vote
3answers
156 views

Mapping a range of IP's to a domain name in hosts file

I work with Wi-Fi. Due to that my system's IP changes every time I connect to the network. For my work, I need to map my IP to a specific domain name. So, every day I need to make changes in my hosts ...
1
vote
1answer
334 views

How do I modify my hosts file in Nixos?

Seems my hosts file (/etc/hosts) points to /nix/store/gds7bha3bx0a22pnzw93pgf0666anpyr-etc-hosts and is read only. How am I meant to modify this file?
0
votes
2answers
97 views

program/application or script that reads /etc/hosts

What is the name of the program or script that opens and reads /etc/hosts when name resolution is needed? and is it different for every linux/unix distro? I read the man page for hosts and tried ...
1
vote
2answers
189 views

Use reference to file instead of IP in /etc/hosts

From my host with hostname localhost, I would like to reach an external host with hostname exthost through the internet. The public IP address of exthost is dynamically assigned by the Internet ...
1
vote
0answers
30 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 ...
3
votes
0answers
74 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 ...
5
votes
1answer
520 views

Ubuntu /etc/hosts addresses in the form *.*.*.*

Let's say a website does not have a domain name like www.google.com and the only way to connect to it is to use an IP address like 216.58.212.68. If I add an entry in /etc/hosts that looks likes 0.0.0....
2
votes
2answers
407 views

how to configure /etc/hosts properly [duplicate]

I'm learning about networking, at home I have two physical machines and a bunch of VMs that I use to test my applications each machine has a different hostname and I map them manually in each /etc/...
1
vote
1answer
800 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 ...
2
votes
1answer
28 views

Some hostnames in hosts file do not resolve [closed]

My hosts file has two entries in the same range: 84.xxx.xxx.111 serverA 84.xxx.xxx.112 serverB I can ping serverA BUT I can't ping serverB for which I get Unknown Host. /etc/resolv is fine [...
0
votes
0answers
105 views

adding a fully qualified name for the server in /etc/hosts for oracle installation

So this is a area I don't clearly understand (adding ip addresses, hostnames and mapping etc...). In the guide for oracle database installation here, it is mentioned that adding a qualified name for ...
1
vote
1answer
181 views

How can I create a multiline entry in /etc/hosts?

We have a situation where we have many aliases for an IP address and these aliases need to be defined in /etc/hosts. Rather than having extremely long lines containing all the aliases for an IP ...
1
vote
2answers
4k views

How to map an IP address to localhost

So I have an IP Address 5x.2x.2xx.1xx I want to map to localhost. In my hosts file I have: cat /etc/hosts 127.0.1.1 test test 127.0.0.1 localhost # The following lines are desirable for IPv6 capable ...
-1
votes
1answer
119 views

Setting up hostname, hosts & domain correctly [closed]

I'm new to this platform but I try to be as specific as possible. I researched quite a lot but every new answer just adds to the confusion at the moment. I am running Debian on my first server with a ...
0
votes
1answer
100 views

Why do i need www. and non www in /etc/hosts

Why for some website to get blocked by the /etc/hosts file I need the www version and the non www version. While for others the non www version in enough ? on surviv.io I need both 'versions': 0.0.0....
0
votes
2answers
7k views

What is the proper way to display IPv6 Addresses in /etc/hosts

I've been tasked with writing a document on IPv6 for my colleagues to learn how to configure IPv6 addresses on our hosts. We primarily use RHEL6.x/7.x, ESXi, and Ubuntu Server. This only pertains to ...
0
votes
1answer
91 views

How can I apply domain search paths to /etc/hosts lookups?

I have a server with search example.com in resolv.conf, and it works correctly for DNS lookups. That is, if I ping host, and host1.example.com is in DNS, it is found. But if host1.example.com is in /...
1
vote
1answer
46 views

How to see which website an app is trying to access?

Hello Unix StackExchange, I've recently started using StevenBlack's /etc/hosts file, and it seems to have broken some apps I've been using. So far I've noticed that Thunderbird can't log into GMail ...
18
votes
3answers
16k views

What is the purpose of /etc/hosts?

As I understand it, the hosts file is one of several system facilities that assists in addressing network nodes in a computer network. But what should be inside it? When I install Ubuntu by default ...
0
votes
2answers
155 views

IP address in /etc/hosts that will always fail?

I know that you can add hostnames to /etc/hosts so that resolving them doesn't actually perform a DNS lookup. This would be a line such as 123.45.67.89 myhostname My question is, what can I set the ...
1
vote
0answers
339 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 ...
1
vote
1answer
29 views

Find where a hosts rule is defined on macOS

Is there a way to find out how my system came up with the IP address for a certain domain? On my machine, pinging analytics.google.com returns 127.0.0.1, and I don't know how it came up with that. my /...
1
vote
1answer
152 views

/etc/hosts not blocking anything

I am trying to use /etc/hosts on my mac to block infamous scumbag sites like mackeeper.com and com-cleaner.systems from ever loading again in popups. While doing that I've found these entries on my ...
3
votes
1answer
2k views

Only use /etc/hosts for resolving hostnames on Linux

I want to disable DNS lookups via DNS server and only resolve host names that are listed in /etc/hosts. I am on Raspbian 9. How would I set this up?
0
votes
0answers
92 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* ...
2
votes
1answer
369 views

Is it possible to redirect all wikipedia urls to wikipedia zero via hosts file?

I would like all links and address bar entries in the pattern https://*.wikipedia.org/* to be redirected to https://*.0wikipedia.org/* I tried to achieve this by adding these entries to /etc/hosts ...
0
votes
1answer
74 views

My Linux server forgets its host name every day

I have a Linux server # uname -a Linux site 3.12.39-47-default #1 SMP Thu Mar 26 13:21:16 UTC 2015 (a901594) x86_64 x86_64 x86_64 GNU/Linux # lsb_release -a LSB Version: n/a Distributor ID: SUSE ...
42
votes
5answers
5k views

What is the /etc/hosts size limit?

How can I determine or set the size limit of /etc/hosts? How many lines can it have?
0
votes
1answer
2k views

Curl localhost from within vagrant VM results in 'Empty reply from server'

I started a deepstream server in a vagrant vm. The server says it's Listening for websocket connections on 0.0.0.0:6020/deepstream The /etc/hosts in the vm: # 0.0.0.0 localhost 127.0.0.1 ...
0
votes
1answer
9k views

Set a host name alias in /etc/hosts?

I'm having an issue relating to host names and SSL signing. The certificate signing process works fine if my host name is puppet. With the IP of the puppet master server being set in /etc/hosts. I ...
0
votes
1answer
556 views

ntpdate IPv4 query to localhost ntp server failing

the command ntpdate -q -4 localhost in an NTP server is making two queries to 127.0.0.1 and one of them fails: is this failing because of the /etc/hosts file? ntpdate -q -4 localhost server 127.0.0....
1
vote
2answers
759 views

Blocking telegram using /etc/hosts

I'm using /etc/hosts to block domains that I don't want to be accessible, and it works for most domains. However it doesn't seem to be working for the Telegram webchat (web.telegram.org). I have the ...
0
votes
1answer
42 views

how to allow specifiy incomming ssh users,even after blocking specific hosts?

i want to take ssh by one specific user in linux. also i block all other IP to take ssh except some specific IP. my /etc/hosts.allow file is sshd : localhost : allow sshd : 192.168.1.23 : allow sshd :...
4
votes
0answers
523 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 ...
1
vote
1answer
306 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 ...
1
vote
0answers
136 views

How can I connect to my server via its domain name, after redirecting it to the internal IP via /etc/hosts? [closed]

I recently changed my /etc/hosts file so that I can directly connect to my server via its internal IP (rather than using internet bandwidth by sending data out of our intranet). Here is the entirety ...