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

learn more… | top users | synonyms

0
votes
0answers
25 views

Linux Mint keeps dropping /etc/hosts [closed]

I reloaded my machine two days ago. In the proccess of restoring my configuration I accidentally over-wrote my /etc/hosts file without making a backup. Since then, I have an issue with any of the ...
0
votes
1answer
24 views

hostname -f .com.com

I modified my /etc/hostname file and /etc/hosts like that: hostname.com and 127.0.0.1 localhost.localdomain localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ...
5
votes
2answers
25k views

How can I configure /etc/hosts file to point to apache web server?

I have installed apache web server and I need to point 127.1.1.1 with alias (www.someaddress.lan) to local apache. What is the proper way to do it? How to point someaddress.lan to default apache page ...
0
votes
1answer
40 views

How to host a website on kali linux virtualbox machine? [closed]

I have a puzzle, shown here: http://imgur.com/a/ijyPf. How do I host my website on a Kali Linux virtual machine? How do I access my website with my public IP? I just don't know where to start and ...
0
votes
1answer
30 views

DRBD - 'node1' not defined in your config (for this host) - Error when setting Primary [closed]

I am getting the following error when trying to set the Primary node for DRBD. 'node1' not defined in your config (for this host). I know this is related to DNS/Hostname/Hosts and the config ...
3
votes
1answer
4k views

Using /etc/hosts or iptables to redirect site to https:// version

I'd like to have my system automatically take me to https://facebook.com even if I put http://facebook.com into my browser. I can get /etc/hosts to redirect to me to different domains, but it seems ...
11
votes
2answers
19k views

Hosts file: Is it incorrect to have the same IP address on multiple lines?

For a while I have been formatting my hosts file like this. Notice the same ip on two lines: e.f.g.e foo.mydevsite.com e.f.g.e foo.myOtherDevSite.com I read recently that aliases are supposed to ...
0
votes
1answer
19 views

Is it okay to add something non-TLD non-hostname as a host alias?

I added some custom (non-TLD) aliases to my /etc/hosts to get rid of IP addresses in my services configuration files. Are there any caveats/gotchas/security implications i should be aware of?
1
vote
1answer
302 views

how do I set a hostname in yast?

how do I set the hostname, FQDN, in yast? I ran yast => network devices => network services => hostname/DNS: YaST2 - lan @ arrakis Network Settings ...
2
votes
1answer
46 views

Should /etc/hosts contain an entry for the FQDN that maps to a loopback address? [closed]

We have a Debian 8.2 system foo provided by our IT department for production. Its /etc/hosts file contains these two lines: 127.0.0.1 localhost 127.0.1.1 foo.example.com foo This maps ...
0
votes
2answers
547 views

Why is my /etc/hosts file not being read?

My /etc/hosts file looks like this: # Your system has configured 'manage_etc_hosts' as True. # As a result, if you wish for changes to this file to persist # then you will need to either # a.) make ...
0
votes
1answer
38 views

Why doesn't 'sudo' skip hostname-checking when the command can be run on 'ALL' hosts?

The sudoers file provides a way to limit which "runas" entries apply to which hosts. When running a command with sudo, the hostname is checked against the hosts on which a "runas" entry applies. When ...
1
vote
2answers
338 views

Editing my /etc/hosts.deny

I'm being trolled by China, and don't know why I can't block their request to my server. //host.deny ALL: item.taobao.com ALL: 117.25.128.* But when I watch the error log on my webserver tail -f ...
0
votes
1answer
66 views

Creating a virtual host

I'm using Kali Linux (backtrack Linux) and it already comes with apache, mysql, php (and plenty of other useful languages). I know that of course as with anything, you can programmatically build a ...
6
votes
2answers
6k views

Blocking Websites with /etc/hosts

There's a website, www.example.com, that I tried to block myself from accessing because it wastes too much of my time. So I configured my /etc/hosts file. I added the following lines, to block the ...
97
votes
6answers
41k views

Can I create a user-specific hosts file to complement /etc/hosts?

Is it possible to add a list of hosts that are only specific to a certain user? Perhaps a user-specific hosts file? This mechanism should also complement the entries in the /etc/hosts file.
1
vote
1answer
66 views

Telnetting the local port working but trying with ip not working

My question is similar but opposite to to Telnetting the Local port not working but trying the ip working For me, telnet to the local port works but trying with IP does not work :( I am running ...
0
votes
1answer
63 views

Browse by hostname from internet browser

I can browse my server site using ip:8080 which is inside my home network.But I am not able to browse using hostname:8080 I do not have dns server. I have edited /etc/hosts file to include ...
0
votes
2answers
193 views

Execute browser as root

I need to run my browser as root, in order to gain Citrix receiver, which is executed within the browser, permissions to access and edit the hosts file. Otherwise I get this error: You do not ...
-2
votes
1answer
38 views

The script, which will take IP from the file etc/hosts [duplicate]

I write script, but this does not work. I need the script, which will take IP from the file etc/hosts. How to do it? Script: (This does not work) host=www.example.com ip=$(getent hosts "$host" | ...
-1
votes
2answers
97 views

Resolve domain script [closed]

How to make it work? Script 1: (This does not work) host=www.example.com ip=$(getent hosts | grep $host | awk '{ print $1}') echo $ip Script 2: (This does not work) host=www.example.com ...
1
vote
1answer
54 views

Custom hostnames on /etc/hosts not resolved

I've added a few hostnames in /etc/hosts to resolve to my LXD container: $ less /etc/hosts 127.0.0.1 localhost 127.0.1.1 HOST lemh 10.0.3.219 pma.lemh 10.0.3.219 wp.lemh ...
13
votes
6answers
5k views

Host lookup that respects /etc/hosts

Utilities like host and dig let you see the IP address corresponding to the host name. There is also the getent utility that can be used to query /etc/hosts or other NSS databases. I am looking for ...
1
vote
2answers
212 views

What's the use for the special ipv6 addresses in /etc/hosts?

I have the following block in my /etc/hosts: # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ...
0
votes
1answer
83 views

Why netcat says that the host isn't authoritative?

When trying to establish a TCP connection to my IP address, 192.168.1.42, netcat tells me that the host isn't authorative. That is, [~] $ echo "Hello, world"|nc -c -vv 192.168.1.42 8080 & nc -l ...
1
vote
3answers
76 views

Adding recursive entries into `/etc/hosts`

I'd like to add shorthands for various FQDNs into the /etc/hosts file, such as: pyrrha.compsci.university.org. pyrrha Is there a way to force the local DNS resolver to process the /etc/hosts ...
1
vote
2answers
658 views

Understand hostname and /etc/hosts

In /etc/hostname, I have myname. In /etc/hosts, I have : 127.0.0.1 localhost.localdomain localhost myname ::1 localhost.localdomain localhost myname I have a vague understanding of what ...
4
votes
1answer
1k views

Hostaliases file with an IP address

The HOSTALIASES environment variable allows users to set their own host aliases instead of having to sudoedit /etc/hosts (more details, e.g., at http://blog.tremily.us/posts/HOSTALIASES/) However, ...
-2
votes
2answers
77 views

my linux pc not pingable using hostname

From a remote machine I am able to ping my computer by its IP address, but not by its hostname. How can I make it accessible by its hostname as well?
1
vote
1answer
47 views

how to ensure stable domain names for newly-provisioned cloud server instances?

I've been playing with server configuration management tool Ansible, whose use often depends on reference to a local inventory file containing arbitrary host names. For example, # file: my_hosts ...
9
votes
3answers
37k views

Format of /etc/hosts on Linux (different from Windows?)

Pasted below this question is a sample of a /etc/hosts file from a Linux (CentOS) and a Windows machine. The Linux file has two tabbed entries after the IP address (that is localhost.localdomain ...
1
vote
1answer
211 views

Make user made entries in /etc/hosts permanent

I use Juniper Networks network connect to connect to the office network. Once i am inside the office network, i check the server ips and add entries for them in /etc/hosts file like, 10.199.xx.yy ...
2
votes
0answers
66 views

Absolute domain names in /etc/hosts?

I have a RHEL7.0 host which has this standard entry in /etc/hosts/: 127.0.0.1 localhost.localdomain localhost So resolving localhost.localdomain works: $ ping localhost.localdomain PING ...
0
votes
2answers
574 views

CentOS 6.5 hostname on VPS

I'm trying to change the hostname on my fresh CentOS 6.5 image (VPS) via SSH. The sources I've found all say the hostname can be permanently changed in /etc/sysconfig/network and /etc/hosts, and that ...
4
votes
2answers
444 views

How to make my server use the hosts file to resolve names?

I have a computer with Debian at home, acting as a server with two Ethernet cards: eth0 connected to the router in DHCP mode and eth1 to a switch (static address) that holds four more computers. I'm ...
1
vote
1answer
347 views

Adding alias in /etc/hosts for Linux OVM

I have deployed a CentOS 6.6 VM (hortonwoks sandbox VM) on my Windows 7 OS. The VM publishes apache spark applications through a http url. The url's have the hostname as "sandbox.hortonworks.com" ...
0
votes
1answer
310 views

Proxy server vs /etc/hosts file

I was told today that /etc/hosts is not a viable option for testing a new destination server. The DNS for /etc/hosts modifications could still cache the old DNS settings and we would get incorrect ...
13
votes
2answers
4k views

practical usage of /etc/networks file

What is the practical usage of /etc/networks file? As I understand, one can give names to networks in this file. For example: root@fw-test:~# cat /etc/networks default 0.0.0.0 loopback ...
1
vote
2answers
525 views

Ping a host, check if alive or not, and send result to file via a shell script

To clean out my custom hosts file and remove dead domains on Windows I ping the hosts from domains.txt, and if I get a reply I add that host to result.txt: @echo off >result.txt ( for /f %%i ...
0
votes
1answer
220 views

Resolve Host's IP on VM

I have kind of tricky situation. I have monitoring tool where all my hosts and their VM's (with IP's and so on) are listed. But what I need is to resolve on which host(need it's ip or hostname) this ...
2
votes
1answer
347 views

rhosts changes and re-initializing

I'm having trouble using the r-commands between my servers to do a tape backup. I've been making changes in the .rhosts file, but I'm not sure if the OS reads that file everytime it's called, or just ...
4
votes
1answer
640 views

why are there different formats for the hosts file between OpenSuSE and Ubuntu?

How is 127.0.0.1 related to 127.0.0.2? Using ssh to login to tleilax (OpenSuSE): tleilax:~ # tleilax:~ # hostname tleilax tleilax:~ # tleilax:~ # hostname -f tleilax.bounceme.net tleilax:~ # ...
2
votes
1answer
2k views

Static IP address shifting to 192.168.1.251

I have a system with a static IP address of 192.168.1.150. I configured /etc/network/interfaces manually (i.e. without using NetworkManager.) It is a web server hosting three sites. I am having ...
0
votes
0answers
173 views

Strange things with virtual hosts on Ubuntu 14.04

I struggle for a while to configure virtual hosts (on local computer for development). At last I came to /etc/hosts 127.0.0.2 todo.local 127.0.0.1 kabinet.local todo.local.conf ...
5
votes
4answers
5k views

Maintaining `/etc/hosts` for hosts on DHCP

On my local DHCP network I have different PC's that I need to access remotely. Problem is that their IP's change. Sometimes I plug my laptop and netbook into other people's DHCP networks. My current ...
1
vote
2answers
131 views

bash completion: how to complete a list of hosts for a specific argument?

My programm can have the following format: <command_name> <arguments> <options> -hosts <host1> <host2> ... <hostn> (<more_arguments>) ... I am trying to set ...
0
votes
1answer
594 views

how etc/hosts file is created during Centos 4.9 installation

We have our servers running CentOS 4.9. I want to find how /etc/hosts file is created during installation. A related question here (What creates /etc/hosts (RHEL 5.5)) says that in RHEL 5 /etc/hosts ...
4
votes
1answer
94 views

What application can I use to block hosts with regex?

Is there any tool/application that I can use to block hosts from all forms of connection from my computer? Currently I use /etc/hosts and place the absolute host like this: 127.0.0.1 ...
1
vote
1answer
217 views

Block a certain URL?

I want to deny access to a specific URL. It isn't a whole website, it's a specific URL. I want to do it simply so that some applications including browsers can't make requests for it. I tried this: $ ...
1
vote
3answers
168 views

What will be prioritized in a conflict between ~/.ssh/config hostname and /etc/hosts?

What if one host is defined in /etc/hosts like: 192.168.0.100 server and one is defined in ~/.ssh/config like: Host server HostName 192.168.0.100 and you ssh into server: ssh ...