Questions tagged [hosts-file]
Hosts file is an OS file to map hostnames to IP addresses.
152 questions
-1
votes
2
answers
129
views
I need to hit website with server_ip/path_to_index.html
I am testing @media statements in a locally hosted website I am building but for the life of me can't hit the site with site_IP/virtual_host_name.
If I have access to the hosts file I simply add (site ...
1
vote
1
answer
869
views
Apache 2.4 VHosts with FastCGI and suexec-custom
I have setup at my local machine Ubuntu 22.04 Apache 2.4 with suexec-custom.
In fact, this setup was working from Ubuntu 16 up to this update to 22.04.
I only load some modules, reload some other and ...
1
vote
1
answer
1k
views
Why is *.localhost resolved automatically on Ubuntu but not on MacOS?
I have the same hosts file on both Ubuntu and MacOS.
127.0.0.1 localhost
On Ubuntu:
my-ubuntu$ ping foo.localhost
PING foo.localhost(ip6-localhost (::1)) 56 data bytes
64 bytes from ip6-localhost (:...
0
votes
1
answer
32
views
Priorize DNS records by server locatoion
Recently I had assigned a task where I am suposed to optimize the login time for a Redhat SSO service that is installed on a RHEL 7.9.
This service uses multiple Active directories to validate the ...
0
votes
2
answers
6k
views
use hosts file with proxy
It is obvious that local /etc/hosts file is ignored when using a proxy while browsing.
How can I use hosts file when using a proxy?
I've access to the proxy server. I changed /etc/hosts file on the ...
6
votes
1
answer
14k
views
Wsl ubuntu virtualhost and hosts file on windows
I try to access it through my windows browser and fail. what is my mistake?
I use WSL2 on windows 10, with ubuntu 20.
I have an apache server and a laravel app which I installed at /var/www/law
In my ...
1
vote
2
answers
3k
views
How do I serve a localhost projects on a made up domain, such as mysite.test and testing.test simultaneously?
If this is possible it would save a lot of headaches. I would like to bind made up domains to localhost projects, if that is possible. I am on Ubuntu 20.10.
0
votes
0
answers
40
views
ping returns IP from hosts file but not nslookup in windows 10 [duplicate]
We host our application in two data centers. During a production update, we point the customer traffic to datacenter1 and test the update by adding datacenter2 IP in our hosts file, where the update ...
1
vote
1
answer
524
views
Exclude subdirectory from host resolution set in /etc/hosts (with dnsmasq, or anything else)
I have a local development tool (LocalWP) that sets the path to my local environment by modifying /etc/hosts.
For example, if I set my site in Local to www.foo.com, it'll append the following to the ...
1
vote
0
answers
2k
views
windows 10 localhost resolution slow
i am running a local python server on windows 10 and sending requests to it via the localhost domain are significantly slower than using 127.0.0.1. i have edited my hosts file and the problem occurs ...
-1
votes
2
answers
4k
views
Why Windows 10 Blocks some LAN IPs (192.168..)?
- Summarize the problem:
Windows 10 does not allow visiting my local LAN IPs (192.168.1.0/24), and some domains (that are defined in my hosts file). Error shows in all browsers (e.g. form chrome: ...
0
votes
1
answer
105
views
Do private hostnames correlate with or have any direct effect on public hostnames on a running webserver?
I am running a LEMP webserver on my Raspberry pi using Rasbpian.
The name of my my pi's hostname is raspi-host123.
My local hosts file on my server looks like this:
127.0.0.1 localhost ...
0
votes
1
answer
326
views
AWS listeners interfering with hosts file?
I’m trying to setup a temp WordPress environment to build a new website for a client, but I want to leave the old one in place until the last minute. The old site in up in AWS, new site is traditional ...
-1
votes
1
answer
685
views
isc-dhcp host using files
I configured ise-dhcp-server, which works fine, but my dhcpd.conf is starting to become very big. I'm trying to find information (without results), on whether it's possible to use something like ...
1
vote
0
answers
220
views
Is there any IETF / RFC standard defined for hosts file encoding?
While going through the accepted answer for hosts file ignored, how to troubleshoot?, I observed the statement "The hosts file should encoded in ANSI or UTF-8 without BOM". As I personally faced ...
0
votes
1
answer
295
views
Apache server throw me 502 error when I try to access site with Public IP
I have a little strange case.
I configured two servers in AWS: Develop and QA, the two with Ubuntu 16.04, Apache 2 and PHP 7.0. I created a website en Develop, and configured its VirtualHost file. So,...
2
votes
0
answers
66
views
Hosts DNS vs getting DNS from service
We have a primary, secondary and tertiary servers, all located in different regions. All three machines run Windows Server 2008 R2. The secondary and tertiary servers provide backup for the primary ...
2
votes
2
answers
7k
views
Windows 10 Hosts file alias not working with file share
I am working on a project that requires that I have an alias in my hosts file that maps \\share to localhost. I added this line "127.0.0.1 localhost share" to my hosts file, and when I ...
-1
votes
3
answers
8k
views
Is there a way to ssh using hostname alias without modifying the etc/hosts file?
I spent hours researching how I can automate 100s of hosts that are all under one local domain. (i'm on a ubuntu linux 17.04 machine)
For example, I have node1.domain.org, node2.domain.org, and the ...
3
votes
2
answers
627
views
Windows Server 2012 R2 curious behavior with hosts entry
TL;DR ...our domain policy silently force pushed the LAN settings (including the proxy reference) to my machine on a predefined interval, which happened to be while I was developing but after I had ...
-2
votes
1
answer
58
views
how to establish a connection to a certain domain using domain name [closed]
I have software that requires that I establish a connection to our server "SERVER01" which I am connecting via VPN to the domain "DOMAIN01" The license will not permit me to use the following ...
0
votes
1
answer
462
views
Requesting nginx using a public ip works, but using the host alias doesn't
As the title suggests, I have a public ip address (it's the address for an azure VM running ubuntu server fyi) which has an nginx server listening to requests on port 80.
Entering this public address ...
3
votes
1
answer
289
views
Avoid a faulty server behind load balancer
Environment
We have a solution running that interacts with the Twitter API. The Twitter API endpoint is:
api.twitter.com
We make many calls to the endpoint but we are hitting very rarely any API ...
-1
votes
2
answers
1k
views
restored Wordpress site from DB, wp-login.php redirects to old domain
We have a Wordpress .sql backup which we restored on a linux box. Now we want to log in to the admin console and export the site as XML.
Unfortunately, the wp-login.php redirects to the old ...
1
vote
1
answer
5k
views
Server impersonation - Target account name is incorrect
I am setting up a test Windows 7 workstation in my environment, which I have named DevWS1. This machine needs to be able to connect to development data while looking like it's in the live side of ...
2
votes
3
answers
5k
views
Redis Sentinel Configuration and Hostnames
I have 2 sentineles and 2 redis servers. I want to configure sentinels using hostnames of redis servers. Currently, I define each hostname in hosts file like this.
10.22.20.156 clsupport1
10.22....
3
votes
2
answers
8k
views
Altering hostname-IP mapping within a browser
A common way to test an existing website on a new server before switching it to production by updating the DNS record is to change the hosts file on a development machine (/etc/hosts on *NIX systems, ...
1
vote
2
answers
244
views
Testing domain with host file
I'm currently working migrating a WordPress installation (live on the web) from one hosting solution to another. In doing so, I am testing the new hosting solution (shared server) by editing my local ...
-1
votes
1
answer
2k
views
Hostname is not mapped to the ip address correctly [closed]
I recently installed Wordpress on my home server running Arch Linux. Everything else works smoothly except that when try to access the server externally, the style sheet is not rendered. I have read ...
2
votes
1
answer
4k
views
KMS activation without DNS
I'm loading a small sized isolated lab with Windows 7 and Office 2013. There are enough hosts to use KMS. In addition the lab does not have DNS as a service available, every host will use a static ...
16
votes
1
answer
37k
views
Nslookup not using hosts file
So I've set public IP on the hosts file for a certain public IP address, but it picks up private ip from nowhere or from DNS.
Content of windows hosts file C:\Windows\System32\drivers\etc\Hosts
...
0
votes
0
answers
218
views
Is this a Windows 7 Bug Caused by the Computer's IP in the Hosts File?
Our lab uses several ruggedized military laptops in a closed-network business environment. These computers are running identical Windows 7 versions, networked with static IP's, running Apache Tomcat ...
11
votes
2
answers
18k
views
Map IP to another IP
Assume the following scenario, if I have a local machine (A) the requests another machine (B) using B's internal IP without regard the ports. But A and B are not on the same network, however, B has a ...
11
votes
2
answers
23k
views
Cannot write to /etc/hosts file from Dockerfile with RUN
I am making a docker image using a pretty simple Dockerfile. Inside the Dockerfile I have this command:
RUN printf "192.92.13.243 www.hahaha.com \n" >> /etc/hosts
The command itself seems to ...
0
votes
0
answers
491
views
Lynx command line browser and the 'hosts' file
I am building a small web app for my company and currently I have this weird issue:
I have 2 instances of the web app running, one accessible through the internet and another one for internal ...
2
votes
1
answer
343
views
Slow sudo and ssmtp (hosts file wrong?)
I'm running an Ubuntu Server 12.04.5 LTS and when I type sudo su it takes 30+ seconds to open the shell. Searching on internet, this problem seems related to the file /etc/hosts and /etc/hostname.
...
-2
votes
1
answer
84
views
Serve a single webpage from my IP for a particular host/domain within Windows? [closed]
I am wanting to serve a single webpage from my IP for a particular host/domain within Windows. Is this even possible? Any ideas how to achieve this?
Is it possible to have something like this in "...
0
votes
2
answers
13k
views
How to use pfSense as a firewall in order to assign url whitelists to IP groups
In a corporate network without DHCP, the temporary solution to whitelist a couple of useful sites is to change the hosts file under Windows/System32/drivers/etc/ but since modern sites tend to change ...
1
vote
2
answers
154
views
Share /etc/hosts between root machine and containers
I have a Centos machine with OpenVZ containers. For each container I have an alias in /etc/hosts. I would like to be able to share the /etc/hosts between the root and the containers. Is there a way to ...
-3
votes
1
answer
82
views
Hosts file to block a website [closed]
I have seen a blog saying that we can block some websites using our hosts file. I have tried the same (shown below), but failed.
Entry added in host file as below:
127.0.0.1 www.google.com
I ...
8
votes
2
answers
17k
views
Why not assign the hostname to the loopback address in /etc/hosts?
So I understand that the hostname should (at least in Debian systems) be set in /etc/hostname. To get the FQDN (through hostname -f) the system finds the IP from the hostname through /etc/hosts and ...
3
votes
1
answer
2k
views
Relation between server_name in nginx sites-available, /etc/hosts file and A-records
I have the following two server-blocks in my config-file in sites-available:
server {
listen 80;
server_name www.mydomain.be;
root /usr/share/nginx/html;
index index.html ...
4
votes
3
answers
6k
views
Deny requests for other domains in Apache 2
Let's say I have xy.com running on a server powered by Apache. It's the default virtual host.
Now someone has rewritten his hosts file to redirect yz.com to my server's IP. As my server doesn't know a ...
0
votes
1
answer
329
views
Can winbind influence name resolution in Linux
I have to Linux boxes on vagrant, the have the same /etc/resolv.conf and /etc/hosts, but one is using winbind to do SSO with Active Directory. When I try to resolve the domain controllers with:
dig ...
0
votes
1
answer
605
views
Hostname aliases in LDAP and phpLDAPadmin
What is the best method of storing multiple hostname aliases in LDAP? Currently, the hosts file I wish to migrate has many entries such as
172.24.3.54 workstation114.example.net wks114 exphost3
...
0
votes
1
answer
174
views
How to resolve external host names in a centraliced place
Our LAN is connected to another company's LAN and we have access to some of their servers, but not to their DNS server. When the users need access to some host by name, the solution I have is to go to ...
0
votes
1
answer
5k
views
tftp times out on localhost
On the same server, I can't connect to my in.tftp over localhost name:
$ tftp localhost -c put test.file && echo Sent\!
Transfer timed out.
$ tftp 127.0.0.1 -c put test.file && echo ...
0
votes
3
answers
6k
views
name resolution by name in /etc/hosts
I have to check website performance through various webproxies from my Fedora 19 box, and I want to do that by setting a local resolvable name "proxy" to the DNS resolved names for our proxies in my /...
4
votes
2
answers
4k
views
make dnsmasq ignore specific entries in /etc/hosts
I've set up a machine running dnsmasq, essentially serving its /etc/hosts file. However, there are specific entries which I want in that machine's /etc/hosts, but I don't want served. How can I make ...
1
vote
0
answers
491
views
Clean RHEL5 build from kickstart adds Public IP to /etc/hosts
Our infrastructure has a Kickstart server which can serve up RHEL6 builds with some post-installation scripting that handles customization and configuration. I'm currently in the process of updating ...