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

learn more… | top users | synonyms

0
votes
2answers
46 views

What are the rules that determine the default contents of an /etc/hosts file?

What are the rules that decide what goes into the initial /etc/hosts file of a a server with these characteristics? It has a internal IP address for the internal subnet. which is in the 172.20.x.x ...
0
votes
1answer
25 views

What would be the IP if not mentioned in hostfile

If I ping the host say ABC and there isn't any host to IP mappings mentioned in the /etc/host file then what IP will it take? P.S- The host that I am pinging belongs to an internal network.
0
votes
1answer
51 views

Single source for both .ssh/config and /etc/hosts

I'm looking for a DRY solution that would allow me both ssh server-alias and ping server-alias I know the former is reading .ssh/config, and the latter /etc/hosts, but I'd rather not repeat the ...
0
votes
1answer
40 views

connection to multiple switches from /etc/hosts and export multiple commands output to file

Actually I'm concerning how to log multiple switches listed from /etc/hosts and run on each few commands and store the output to one log file on main linux host. Second question may ask how to connect ...
0
votes
1answer
30 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 ...
0
votes
1answer
58 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
78 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 ...
0
votes
1answer
23 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?
2
votes
1answer
58 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
1answer
40 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 ...
0
votes
1answer
91 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 ...
1
vote
1answer
90 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 ...
-2
votes
1answer
45 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
120 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 ip=$(...
0
votes
1answer
69 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
233 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 ...
1
vote
2answers
453 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 /...
1
vote
1answer
67 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 ...
1
vote
2answers
330 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 ff02::...
0
votes
1answer
97 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 -...
4
votes
1answer
2k 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
87 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
3answers
88 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 ...
0
votes
2answers
620 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 ...
1
vote
1answer
263 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 ...
3
votes
0answers
72 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 localhost....
0
votes
2answers
578 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 ...
5
votes
2answers
548 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
408 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" (e.g....
0
votes
1answer
366 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 ...
1
vote
2answers
613 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 ...
14
votes
2answers
5k 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
1answer
363 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 ...
0
votes
1answer
246 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 ...
1
vote
2answers
794 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
656 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:~ # ...
0
votes
0answers
179 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 &...
0
votes
1answer
616 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
2answers
113 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 unix....
1
vote
1answer
262 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
2answers
142 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 ...
1
vote
3answers
183 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 ...
5
votes
2answers
152 views

Should /etc/hosts contain the domain name or the FQDN?

If I want to add an entry to /etc/hosts to resolve all traffic for example.com to 1.2.3.4, do I need to add 1.2.3.4 example.com 1.2.3.4 www.example.com 1.2.3.4 smtp.example.com 1.2.3.4 ...
2
votes
2answers
256 views

Understanding hostnames

I was recently setting up an MTA on a VPS, and while configuring it I realized I’m quite confused about the concept and implementation of hostnames in Unix. I have a solid understanding of the DNS, ...
0
votes
0answers
56 views

VirtualHost configuration not working

I followed this article, mixed with some other research, in an effort to get VirtualHost configuration up and running on my Mac. However, for some reason when I navigate to my local.site.rocks URL it ...
2
votes
1answer
600 views

Sed to Modfiy Hosts File

I have a text file, modifyhostslist.txt, which contains entries that correspond to entries found in my hosts file. Not every entry in my hosts file needs to be modified, only entries also found in ...
7
votes
2answers
536 views

What is the reliable way of getting each user's .ssh directory from bash?

I can parse the /etc/passwd with augtool: myuser=bob usershome=`augtool -L -A --transform "Passwd incl /etc/passwd" print "/files/etc/passwd/$myuser/home" | sed -En 's/\/.* = (.*)/\1/p'` ...but it ...
1
vote
2answers
618 views

Browsers doesn't see an aliases in /etc/hosts

A firm where I'm working uses an internal site with documentation and etc. where all references made e.g. to «srv-moss» — this names should be defined in hosts file, where I did added it. It works ...
0
votes
2answers
536 views

Can two hosts have the same IP address in /etc/hosts?

can two hosts share the same IP Address without a conflict. This is how my /etc/hosts looks like :- $ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 debian 127.0.1.1 mini Now as can be seen ...
1
vote
0answers
17 views

Correct format to specify the ipv6 address in '/etc/hosts' file [duplicate]

I have configured a server with Gentoo 64 bits that it has IPv4 and IPv6 and they are working well. But I don't know how specify the IPv6 of the server in /etc/hosts file. With or without "/64" final?:...