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
1 vote
1 answer
78 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 =...
user avatar
  • 69
0 votes
0 answers
43 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 ...
user avatar
0 votes
2 answers
65 views

Debian /etc/hosts has unusual entry

I switched from Ubuntu to Debian And in debian the /etc/hosts file after a new install is (on a cloud server): 127.0.1.1 static.246.62.63.178.clients.your-server.de static # The following lines are ...
user avatar
0 votes
0 answers
8 views

sappend flag is set, but file is read-only

I'm trying to set my /private/etc/hosts file on my Macbook (MacOS Catalina) to append-only (so I can easily add entries, but not remove them) I tried setting the sappend flag, but it doesn't quite ...
user avatar
1 vote
1 answer
49 views

Random DNS errors after change to nsswitch.conf

I recently installed my EPSON L3150 printer's drivers and about the same time I started having weird (and random) DNS name resolution errors in some applications (ssh, nextcloud-client), that I can ...
user avatar
  • 519
0 votes
1 answer
12 views

How to change the host address that my web server listens on?

I am setting up a web server on my Ubuntu host. To be specifically, it is gdbgui. According to its help info, I can use --host to specify the host IP it listens on. And on my host, I have below IP ...
user avatar
  • 1,041
-2 votes
1 answer
206 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 ...
user avatar
0 votes
2 answers
266 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, ...
user avatar
  • 11
1 vote
0 answers
225 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 ...
user avatar
  • 485
0 votes
1 answer
222 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 ...
user avatar
0 votes
1 answer
35 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-&...
user avatar
0 votes
1 answer
102 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 ...
user avatar
  • 109
0 votes
1 answer
57 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 ...
user avatar
3 votes
1 answer
164 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-...
user avatar
  • 35
0 votes
0 answers
40 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 ...
user avatar
0 votes
1 answer
3k 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 ...
user avatar
0 votes
1 answer
186 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....
user avatar
0 votes
0 answers
61 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 ...
user avatar
0 votes
2 answers
70 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 ...
user avatar
  • 155
0 votes
0 answers
77 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 ...
user avatar
  • 259
2 votes
1 answer
512 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 ...
user avatar
1 vote
1 answer
803 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/...
user avatar
1 vote
0 answers
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 ...
user avatar
3 votes
2 answers
205 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 &...
user avatar
0 votes
1 answer
180 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 ...
user avatar
1 vote
1 answer
1k 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: ...
user avatar
  • 113
1 vote
1 answer
94 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 ...
user avatar
  • 207
1 vote
1 answer
196 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 (...
user avatar
  • 111
3 votes
1 answer
673 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 | ...
user avatar
  • 932
1 vote
1 answer
487 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....
user avatar
  • 351
2 votes
2 answers
3k 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: ...
user avatar
  • 111
0 votes
1 answer
98 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 ...
user avatar
-2 votes
2 answers
42 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-...
user avatar
1 vote
1 answer
372 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 ...
user avatar
1 vote
1 answer
286 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 ...
user avatar
  • 131
0 votes
1 answer
291 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?
user avatar
  • 109
0 votes
2 answers
138 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 ...
user avatar
0 votes
1 answer
6k 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 ...
user avatar
  • 149
2 votes
2 answers
23k 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 (...
user avatar
  • 21
0 votes
1 answer
207 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....
user avatar
0 votes
1 answer
364 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 '...
user avatar
0 votes
2 answers
163 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 ...
user avatar
0 votes
1 answer
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 ...
user avatar
  • 277
0 votes
1 answer
2k 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) ...
user avatar
0 votes
1 answer
1k 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@...
user avatar
0 votes
1 answer
49 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....
user avatar
  • 123
10 votes
1 answer
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 ...
user avatar
  • 753
20 votes
2 answers
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 ...
user avatar
  • 303
-1 votes
1 answer
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 ...
user avatar
  • 11.1k
0 votes
3 answers
4k 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....
user avatar

1
2 3 4 5