Questions tagged [hosts]

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

/etc/hosts is the configuration file with locally known mappings between domain name and ip address. It can be used to define new or override existing mapping, bypassing the DNS that would normally resolve it.

271 questions
0
votes
0 answers

Windows 2012 - Powershell v4 update hosts file without restarting

I wrote a Powershell script where I update hosts file at runtime: add entries, clear entries. An example of what I am doing: Import-Module 'Carbon' #Carbon module functions Reset-HostsFile #No exception expected $result = Invoke-Webrequest -Uri…
0
votes
0 answers

Access docker container from another container via local hostname

I have two dockerized apps, each consisting of an nginx + php-fpm container sitting behind another nginx proxy container. Both apps I can access via a locally defined hostname, say domain-1.dev and domain-2.dev. Here's my hosts file: 10.0.75.1…
David
  • 145
  • 1
  • 2
  • 7
0
votes
1 answer

Define hosts in Apache config instead of /etc/hosts?

Is it possible to configure a VirtualHost for Apache with custom hosts settings without modifying /etc/hosts? I want a VirtualHost to connect to a different host for testing then my live system. For example, in my /etc/hosts file I would have…
Misha M
  • 105
  • 2
0
votes
1 answer

Local services unavailable when network cable is unplugged

I cannot access local services such as ldap when a network cable is not connected to the host. Should the address to these local services be the ip to the host or should it be 127.0.0.1 for all of them? This is my etc hosts files: 127.0.0.1 …
joaerl
  • 397
  • 1
  • 3
  • 11
0
votes
4 answers

Wildcard *.local hosts to apache on OS X

I would like to route all my *.local or *.dev domains to a specific IP, either the IP of my Ubuntu VM or localhost. Is this possible? Can I use the /etc/hosts file? I am running Mac OS X Snow Leopard with Ubuntu Hardy Heron LTS - JeOS on VMware…
joelpittet
  • 103
  • 1
  • 4
0
votes
0 answers

/etc/hosts is not processed during boot

I have NFS mounts set up in /etc/hstab as HOSTXYZ:/share/dir /mnt/nfs/local-dir nfs4 _netdev 0 0 It mounts fine when I run mount -a however it hangs during boot. I discovered that if I use IP address instead of HOSTXYZ it boots normally.…
oᴉɹǝɥɔ
  • 151
  • 6
0
votes
2 answers

How can I edit/update hosts(etc/hosts) file using any programming language

Dynamically I want to edit/update hosts(etc/hosts) file to add domain. To edit hosts(etc/hosts) file require Admin privileged. Using Linux I can do this by this command sudo gedit /etc/hosts But I am trying to do this from using Programming…
None
0
votes
1 answer

Local DNS on Amazon AWS

I have an app running on a Linux server that makes use of external services that often don't have public DNS for their domain name. To solve this I add local DNS to my /etc/hosts file - matching the IP address of the service to the domain name. This…
JamesG
  • 115
  • 6
0
votes
2 answers

I need to set up a sftp server, that could use different keys, and use different directories for the same login, depending on the ip used

I got a problem, that I cannot solve myself. I tried to google it, but no satiscactory solution that i could find. I have a server that is available with let's say 3 different IP addresses (A,B,C), and a user login lets say "user". I need to setup…
0
votes
1 answer

How to host two web applications with different "domains" in IIS 8

I have setup to entries in my hosts file: 127.0.0.1 mymvcapp.dev www.mymvcapp.dev 127.0.0.1 mywebapi.dev www.mywebapi.dev In the first I want to host my mvc app and the second entry is for my web api app. Now I have added these two bindings to my…
Legenda
  • 89
  • 7
0
votes
1 answer

HOSTS file not overriding DNS

I have a Server 2012 R2 machine and I have added a hosts file entry for a hostname to point to an IP. However, when doing an nslookup, the HOSTS file does not override the result (from DNS). I can't ping the server, does this matter? Everything else…
Blade1
  • 1
  • 1
  • 1
0
votes
1 answer

CentOS 6.5 Apache redirect to 127.0.0.1

I have to install a new CentOS Server v6.5 I already install httpd and want to access Apache Welcome Page by serverIP. But I get a timeout, so I stop iptables service for a moment. Now I get an 301 redirect to 127.0.0.1 Some information : nano…
GTL-WEB
  • 1
  • 1
0
votes
3 answers

Hosts available via IE only

Here's a situation I haven't seen before: I have a Windows Server 2008 R2 machine that can see other hosts only from Internet Explorer. I can't ping them, can't find them via tracert, etc. All other modes result in an error like "Remote name could…
Justin R.
  • 113
  • 1
  • 7
0
votes
0 answers

Trouble accessing FTP internally

I am currently running OS X Server 4. I have multiple websites (virtual hosts) set up with it. Lets call them domain1.com and domain2.com. Internally, they are both being run off of the same IP. Let's say 192.168.0.5. When I try to access the ftp…
musclez
  • 1
  • 5
0
votes
2 answers

Windows 2012 Server, DNS resolve host for client

I've been looking for way to resolve host name for client on Windows Server 2012, just like if I added it to hosts file of the client workstations running Windows 7/8. In hosts file I would add following entries as example: 192.168.12.145 …