Questions tagged [hosts-file]

Hosts file is an OS file to map hostnames to IP addresses.

Hosts file is an operating system file that maps hostnames to IP addresses. It is a plain text file. In modern operating systems, the hosts file remains an alternative name resolution mechanism, configurable often as part of facilities such as the Name Service Switch as either the primary method or as a fallback method.

150 questions
3
votes
2 answers

mod_unique_id: unable to find IPv4 address of FQDN despite setting etc/hosts and Apache ServerName

I'm trying to get mod_security and hit the very common hostname error of [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "computername.domain.com" This normally means an entry is required in the hosts file.…
KCD
  • 878
  • 3
  • 11
  • 23
3
votes
1 answer

Hosts file entries for multiple domains on VPS?

mydomain is the main domain (in Plesk, Media Temple MT VPS), and under that are several Wordpress sites, like mysite1.com, mysite2.com, etc. Problem is that I get lots of these errors in httpd's error_log: [error] [client 127.0.0.1] script…
markratledge
  • 499
  • 5
  • 13
  • 24
3
votes
3 answers

Error connecting to remote MySQL server [ERROR 1042 (HY000): Can't get hostname for your address]

I have MySQL 5.5 Server setup on a Windows machine. I am able to connect to the server from console / app running on the same machine but not from a remote machine. While connecting using the following command: mysql -h xx.xx.xx.xx --port=3306 -u…
M.N
  • 337
  • 3
  • 7
  • 15
3
votes
1 answer

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 windows hosts file I've added this: 127.0.0.1 …
2
votes
0 answers

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 server. Every week, we do a test fail-over from the…
2
votes
2 answers

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 ping share, I get a response from localhost so I…
riccio
  • 23
  • 1
  • 5
2
votes
3 answers

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.20.157 clsupport2 And I try to configure…
bhdrkn
  • 73
  • 1
  • 8
2
votes
2 answers

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, and %windir%\system32\drivers\etc\hosts on…
Ale
  • 1,613
  • 17
  • 25
2
votes
8 answers

localhost went "It works!" - and nothing else

I'm working with Mac's built in Apache, and everything was just great UNTIL - something went wrong. I think it's the .hosts file. http://localhost results with "It works!" message, while any /[foldername] cannot be found. However, 127.0.0.1 works…
konzepz
  • 209
  • 1
  • 2
  • 7
2
votes
3 answers

Partial HOSTS file read

I've a new entry that I put in the HOSTS file: 10.7.4.94 COMMRTU7 commrtu7 commRTU7 The first two entries ping, but the third one won't ping. I have a list of entries like this that work fine, any ideas why this won't?
Lance Roberts
  • 401
  • 3
  • 12
  • 29
2
votes
1 answer

Host name resolution order - Changes to SYSTEM.INI not reflecting

I added the below lines to my system.ini file to ensure that all host name resolution will happen through hosts file only and all other methods are ignored. [DNS] HostsPriority=1 But, the change doesn't seem to work. After making this change, I am…
2
votes
1 answer

Why does my hosts.deny not work on OSX 10.8?

For testing it I added these four lines to my /etc/hosts.deny file: # /etc/hosts.deny ssh-agent:ALL sshd:ALL   I waited some time and then I tried to gain ssh access to the loop-back IP address. But I still get this: $ ssh root@localhost Password:…
Lenar Hoyt
  • 123
  • 1
  • 5
2
votes
3 answers

Accessing multiple sites from test environment using hosts file

I've got a Windows Server test environment installed as a VM on another company server (e.g. 192.168.2.30) which currently hosts about five different test sites. My local machine contains a line in the hosts file linking the IP address of the test…
2
votes
1 answer

Editing hosts file - will removing default settings cause trouble?

I'm running a CentOS 5.4 machine and had trouble getting sendmail to work. After a bunch of researching, I found out that I needed to change my servers FQDN. /etc/hosts had the following: 127.0.0.1 localhost localhost.localdomain xx.xx.xx.xx…
Arms
  • 123
  • 4
2
votes
3 answers

Windows Server 2008 Administrator can't take Ownership of file

I'm trying to edit the hosts file on Windows Server 2008. I right clicked on Notepad and Ran as Administrator, then opened the hosts file, but when I try to save it I get the following error message: Cannot create the…
Mark
  • 754
  • 1
  • 7
  • 12
1 2
3
9 10