Questions tagged [hosts]

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

Filter by
Sorted by
Tagged with
-2
votes
1answer
98 views

Trying to block website

I have Linux and i try to block website and i have followed this kind of way to block website in my computer.. Steps to block websites in Linux Open terminal shortcut keys Ctrl + Alt + T. Type sudo ...
0
votes
2answers
56 views

Is it possible to block website through system Linux firewall for browser that used DNS over HTTPS?

OS: Fedora 34 Browser: Mozilla Firefox with DoH enabled I'm trying to block website through core Linux settings (not web browser extension etc). Problem is inside DoH that I'm using. If I disable DoH, ...
0
votes
0answers
52 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 ...
0
votes
1answer
168 views

How can I push to GitHub when it's blocked?

Right now, https://github.com is blocked with 127.0.0.1 github.com www.github.com in the /etc/hosts file. However, I need to push from git to GitHub. How can I achieve this without editing my hosts ...
0
votes
1answer
32 views

copy files from multiple remote machines to local and create directories for remote machines

Have multiple vm machines that am using for studying, and have come up with this script for copying some files from vm's to my local machine: SG=rohos; date; for i in `cat /etc/hosts | grep "$SG-&...
0
votes
1answer
70 views

Blocking domain on host, results in blocking domain on guest VM (QEMU/KVM)

Desired Outcome I want to block a.com on a host machine, but allow it on a guest VM. (I would also like to use dnsmasq to re-point domains on the guest machine independently.) Details On a Linux Mint ...
0
votes
0answers
18 views

Chrome (on OS X) seems to be able to magically circumvent /etc/host redirects

For security reasons, I replace /etc/hosts on my machine with a version that redirects many domains to 127.0.0.1. Mostly this works fine, and I test by ping and by trying to browse to those sites. ...
0
votes
1answer
35 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 ...
3
votes
1answer
159 views

Why is bash listing the effective content of /etc/hosts if I press Super_L+Space?

The title pretty much sums it up. I have some (minimal) content in /etc/hosts. The file looks something like: # some comment 127.0.0.1 localhost foo bar 1.2.3.4 baz ::1 localhost ip6-...
0
votes
0answers
39 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 ...
0
votes
1answer
1k views

The authenticity of host can't be established but that host is in known_hosts file

In order to skip initial SSH negotiation, I have added the public key of the server I am going to connect to inside my known_hosts file, following these suggestions. However, when trying to connect to ...
0
votes
1answer
83 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....
0
votes
0answers
42 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 ...
0
votes
2answers
62 views

My /etc/hosts is having no effect

I added a large number of domains to my /etc/hosts, in the hope of preventing outgoing traffic to those sites. Now I have found however that my /etc/hosts is having no effect. It's meant to serve as a ...
0
votes
0answers
43 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 ...
2
votes
1answer
346 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 ...
1
vote
1answer
743 views

Arch linux: spotify stuck offiline

I have installed spotify on arch linux via yay. When I open spotify it says it is offline even when I have working internet connection and throws error code: 4 This is log of spotify: spotify: /usr/...
1
vote
0answers
22 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 ...
3
votes
2answers
136 views

Can a line in /etc/hosts on Linux contain just an IP address?

I am closely working on /etc/hosts file in Linux. I have designed some operations for /etc/hosts file like add, modify and delete. I have read little about /etc/hosts and got to know that it contains &...
0
votes
1answer
115 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 ...
1
vote
1answer
779 views

Ansible - Access group variables in tasks

I have my inventory file configured with group variables. Example: all: children: europe: vars: network_id: 3 network_name: "europe-eu" hosts: ...
1
vote
1answer
73 views

Hosts.deny on FreeBSD suddenly empty?

I'm wondering why a hosts.deny file with about 600 denied IPs and ranges would sudden empty itself. Is there any reason for this to happen automatically? No one else has connected to the server to ...
1
vote
1answer
146 views

Unable to resolve entry in hosts file?

I have the following entry in the hosts file: 127.0.0.1 postgres This works most of the time: [root@l25 log]# ping postgres PING postgres (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (...
2
votes
1answer
317 views

bash like autocompletion for ssh command in zsh shell with /etc/hosts file?

zsh is great so far. I am using zsh-completions but still I am unable to get autocompletion for ssh commands like in bash as shown in below screenshot: How to get hostnames from /etc/hosts for ssh | ...
1
vote
1answer
316 views

How do I write dig output to /etc/hosts file?

I'm a shell beginner and here's an example, I don't know how to implement it. Any help, thanks in advance! Step 1: Get the domain resolution A record via dig. dig @8.8.8.8 liveproduseast.akamaized....
2
votes
2answers
2k views

Device or resource busy - getaddrinfo

I'm on a CentOS 7 VM running PG, MariaDB, sidekiq and apache httpd. Sometimes my logs are spammed with errors such as: unable to resolve address: System error WARN: Mysql2::Error::ConnectionError: ...
0
votes
1answer
83 views

What will happen if I add 1 million lines in /etc/hosts/ [duplicate]

I am trying to write a website blocker and the simplest thing I found is putting lines at the end of /etc/hosts. If I want ot have 1 million websites blocked that redirect to localhost would that slow ...
-2
votes
2answers
39 views

How do I modify the lines in a etc/hosts?? Add # in the beginnig of the line which has specific domain?

I have a host file which has about 15 lines of a specific host entry. All these host entries has the text # Entry added by Automation in the entry. For example: 10.122.123.124 file1.auto.test-...
1
vote
1answer
264 views

Why adding hostnames to /etc/hosts entries change the website viewed

Ippsec does a lot of hackthebox boxes walkthroughs and in many of them he edits the /etc/hosts file. Sometimes he adds multiple hostnames to the same ip address and when he browses those hostnames he ...
1
vote
1answer
213 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 ...
0
votes
1answer
258 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?
0
votes
2answers
103 views

Get all the open ports for a remote host in linux

Trying to connect to a particular port for a remote host. The host is reachable (checked via ping command) but the port is not accessible. Is there any way to check all accessible ports for that ...
0
votes
1answer
5k views

Entry in /etc/host file not working

I am facing an issue when I make the entry 192.168.32.56 example.org in /etc/hosts file ,it does not work. But when I remove it , it starts working. Below is my /etc/hosts file for Ubuntu 16 . I ...
2
votes
2answers
20k views

How can I fix? Systems says "Host is down" and will not boot

After reboot, Debian GNOME desktop starts up automatically, in tty. When I try to start or stop services with systemctl this message appears. System has not been booted with systemd as init system (...
0
votes
1answer
172 views

tcpd, inetd/rinetd and iptables

What is the correlation between these programs? tcpd and inted/rinetd are very old but despite this they are still present in many distributions ... why? And there is also a correlation between hosts....
0
votes
1answer
249 views

Clarifications for SSH tunnels over HTTP (or HTTPS)

I noticed that when I create a tunnel locally from my PC to the remote one, for some devices (generally routers), the connection via http or https does not take place. I get a pop-up that says: The '...
0
votes
2answers
147 views

Different IP:hostName mappings for same host in `/etc/hosts`. Why does this work?

My scenario Relevant entries in my /etc/hosts (I have them written in the same order you see them here) 172.22.5.107 www.wordpress-rend-adri.com 192.168.1.116 www.wordpress-rend-adri.com I use ...
0
votes
1answer
2k views

/etc/hosts and aliases

I puchased a domain, say fireworks.com, and I would like to call my server ubuntu-18-04. How am I expected to edit /etc/hosts? Is it possible to add multiple aliases as follows? 127.0.0.1 ...
0
votes
1answer
1k views

Correct /etc/hosts configuration in ubuntu 18.04

Hello i want to have three virtual severs in my localhost Virtual machine Ubbuntu 18.04. Id like one localhost -> /var/www/html one onlyoffice.eduardo.com -> /var/www/onlyoffice ( document server) ...
0
votes
1answer
976 views

`hostname` result is different from “/etc/hostname”! [duplicate]

If I open a terminal windows in my graphical user interface, hostname command result is different from content of /etc/hostname: me@ZyXEL1:~$ hostname ZyXEL1 me@ZyXEL1:~$ cat /etc/hostname N4010 me@...
0
votes
1answer
45 views

Pair two file / Remove duplicate entries

I have two host file list like this: file1.hosts 0.0.0.0 site1.com 0.0.0.0 site2.com file2.hosts 0.0.0.0 site1.com 0.0.0.0 site3.com Now I want one list that looks like this: hosts.hosts 0.0.0....
10
votes
1answer
1k views

Why does localhost resolve to ::1 but not 127.0.0.1

With getent hosts localhost, I only get ::1, although I expect 127.0.0.1. I have IPv6 disabled, so getting ::1 is even more surprising. To add to the confusion, when I ping localhost, pings are sent ...
20
votes
2answers
7k views

Why do changes to /etc/hosts take effect immediately?

Changes to /etc/hosts file seem to take effect immediately. I'm curious about the implementation. What magic is used to achieve this feature? Ask Ubuntu: After modifying /etc/hosts which service ...
-1
votes
1answer
29 views

Is it ok to combine machines with DNS server management and machines that do host lookups through a hosts file?

We have a cluster of Linux machines. DNS of these machines is managed by a DNS server (a Windows machine with DNS records). Now we want to add an additional cluster with Linux machines that would do ...
0
votes
3answers
3k 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
195 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
1k 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
88 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....
2
votes
0answers
128 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
231 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
2 3 4 5