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

learn more… | top users | synonyms

0
votes
1answer
29 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
25 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
49 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
24 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
76 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 ...
0
votes
1answer
47 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 ...
1
vote
2answers
133 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
222 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
35 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
96 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
59 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
514 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
66 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
58 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
353 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
122 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
61 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
564 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
352 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
247 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
234 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
415 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 ...
13
votes
2answers
3k 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 ...
0
votes
0answers
199 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
171 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
408 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 ...
3
votes
1answer
548 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
162 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
527 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 ...
3
votes
1answer
83 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
156 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
116 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
140 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 ...
4
votes
2answers
128 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
226 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
51 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
479 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
507 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
432 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
463 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" ...
0
votes
1answer
186 views

Linux hosts.deny settings are not applied

I want to make a bunch of websites unaccessible on my computer. My hosts.allow file: sendmail: all # /etc/hosts.allow: list of hosts that are allowed to access the system. # See ...
3
votes
2answers
2k views

allow only specific users to login via sshd, but refuse connect to non-listed users

I'm running a CentOS server (7.0) and I'd like to login via sshd as a user, not root. So I set PermitRootLogin no in the config file and su - after login. I've received lots of hacking activities and ...
1
vote
1answer
1k views

Reject SSH connections from unlisted countries, using hosts.allow/hosts.deny on CentOS

I was trying for few hours to make my custom script work when using hosts.allow/hosts.deny, to prevent connections to SSH and other services supporting TCP wrappers from unlisted countries. Example ...
2
votes
2answers
4k views

Ping multiple hosts and execute command

I'm very new in bash scripting and unix so I will need some help on this.I have 7-10 hosts which I want to ping from one of the servers via cronjobs. What I want is when host is up to execute command ...
2
votes
0answers
384 views

DNS works half of the time in Oracle VirtualBox and I can't even maintain /etc/hosts file

I have installed three Linuxes on same laptop and same VirtualBox and this is my success ratio with DNS: HortonWorks & CentOS. Worked for 5 minutes and never after that again. VM image ...
8
votes
2answers
3k views

How to test /etc/hosts

What's the best way to confirm that your /etc/hosts file is mapping a hostname to the correct IP address? Using a tool like dig queries an external DNS directly, bypassing the hosts file.
1
vote
1answer
44 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 ...
1
vote
2answers
1k views

How to change the name of localhost to a custom name which is available to other users in LAN

I need to use the a custom URL name which is accessible from all devices in a LAN. I know that it can be set in the /etc/hosts file 127.0.0.1 myname 127.0.1.1 system09-System-Product-Name # The ...
1
vote
2answers
619 views

Does dropbear take care of hosts.allow and hosts.deny?

I'm running dropbear as SSH daemon on Debian (actually Raspbian). I tried setting # /etc/hosts.allow dropbear:192.168.1.1 # my static ip from which I SSH connect to the device and # ...