Questions tagged [hosts]
/etc/hosts is the configuration file with locally known mappings between domain name and ip address.
227
questions
0
votes
2
answers
55
views
How do you redirect your local machine to go to www.google.com when www.microsoft.com is entered in the browser's URL bar?
If I modify my /etc/hosts file from this:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 ...
0
votes
0
answers
47
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 ...
0
votes
0
answers
23
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 ...
1
vote
1
answer
45
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 ...
0
votes
1
answer
59
views
Why do I get different browser behaviour when attempting to reach bitcoin.stackexchange.com and the alias of its IP in /etc/hosts?
I haven't found any browser that supports aliases defined in /etc/hosts even when single terms (without having to prepend in the browser with http://) are not interpreted as search terms for the ...
0
votes
1
answer
76
views
/etc/hosts alias or multiple record
I want to know what is different between this two configuration :
First :
127.0.0.1 localhost my-hostname
192.168.10.12 host-a a.com
Second :
127.0.0.1 localhost my-hostname
192.168.10....
0
votes
1
answer
62
views
Can't connect to domain listed in /etc/hosts connects via IP
Debian 12/Bookworm headless host
I have a local container running with an IP of 10.88.0.2. I can access the container via IP:
root@dev ~# ping -c2 10.88.0.2
PING 10.88.0.2 (10.88.0.2) 56(84) bytes of ...
0
votes
3
answers
109
views
Is checking /etc/hosts and /etc/resolv.conf sufficient to know that no server is trying to falsely represent itself as another?
Say I want to make sure that no malicious actor or process has made an attempt to falsely represent a legitimate web server with their own malicious server on Linux, anticipating that the user will ...
0
votes
0
answers
63
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 ...
3
votes
1
answer
4k
views
What is the purpose of the 127.0.1.1 entry in /etc/hosts?
Been googling this but found very ambiguous answers and I'm curious if I should modify these values, my VPS hosts file looks like this:
127.0.0.1 localhost
127.0.1.1 debian
144.17.4.xx porter.info ...
1
vote
0
answers
997
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 "...
0
votes
1
answer
73
views
Create hostnames per IP on Debian
I use a server with multiple IP addresses as a Squid proxy. Sadly every query to every IP address will expose the primary hostname of my webserver. So I added the following lines to my /etc/hosts file:...
1
vote
2
answers
416
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 ...
1
vote
0
answers
135
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 ...
2
votes
2
answers
1k
views
Why accessing 0.0.0.0:443 gets redirected to 127.0.0.1:443 on Linux and how to disallow it?
tl;dr: accessing 0.0.0.0:port (eg. curl http://0.0.0.0:443) gets redirected(internally) to 127.0.0.1:port (where port is any port number) (eg. the previous curl command is the same as curl http://127....