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

learn more… | top users | synonyms

4
votes
2answers
177 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
49 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
53 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
85 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 ...
11
votes
2answers
343 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
32 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
49 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
1answer
50 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
103 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
72 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
0answers
20 views

What's wrong with the mapping?

I am running two docker containers one is for hadoop basic services and other is for flume. Services are running successfully. I linked two containers env variables are automatically set by docker ...
0
votes
1answer
255 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
57 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
59 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
63 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
68 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 ...
3
votes
2answers
76 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
152 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
41 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
253 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 ...
6
votes
2answers
414 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
132 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
242 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
16 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
93 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
639 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
565 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
1k 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
272 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 ...
7
votes
2answers
1k 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
0answers
30 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
456 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
424 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 # ...
4
votes
1answer
5k views

Postfix email bounced (mail for domain loops back to myself)

I have problem when i send a mail to example@orbialia.es for example2@orbialia.es My emails has bounced for this error: status=bounced (mail for orbialia.es loops back to myself) May 9 09:33:58 ...
3
votes
1answer
1k 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 ...
1
vote
2answers
1k views

How to edit /etc/hosts without sudo?

I have a machine that I can only access using SSH. I was messing with the hostnames, and now it says: ssh: unable to resolve hostname I know how to fix it in /etc/hosts. Problem is, I need sudo ...
1
vote
1answer
758 views

Dynamically change /etc/hosts

Each time I change my IP address I have to go edit /etc/hosts and change the line: myPc-Vaio 192.168.1.x I need this change for some programs I am using, so I can't just set the line to 127.0.0.1. ...
3
votes
1answer
239 views

tcpdump command works only on local ip

I am trying to capture some IP packets in my personal LAN with tcpdump, through the command tcpdump -A -i eth0 'tcp and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) ...
1
vote
1answer
41 views

Which kind of additional cleanup may be required after removing manually added entries from /etc/hosts?

My system is "Unable to resolve" removed entry from /etc/hosts. During development, I needed to add the custom domain entry to /etc/hosts, stating it resolves to 127.0.0.1. This mapping worked fine. ...
1
vote
1answer
1k views

One ubuntu machine in LAN cannot access internet

I have 4 ubuntu machines connected in a LAN network by a single switch.Their IP address is from 192.168.10.10-192.168.10.13.But after I restarted one of them since disk problem,I find that this ...
2
votes
0answers
270 views

Why is my /etc/hosts.deny file being ignored?

I am using a small embedded linux setup generated by buildroot to run on a x86 device. It was generated to use busybox init system and also runs dropbear so I can ssh into the device. I wanted to ...
6
votes
2answers
7k 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 ...
3
votes
3answers
2k views

/usr/bin/host not picking up changes to /etc/hosts even after reboot

I have a Ubuntu Server 12.04 (amd64) machine on which, when I change /etc/hosts, the changes aren't picked up, even after a reboot. I am using /usr/bin/host to test, but none of the other programs ...
1
vote
1answer
244 views

Directing hostname to another computer within lan using hosts file

There seem to be more questions like this, excuse me if this is similar. I want to redirect to an IP address om my server computer. This is what I put in my hosts file on the client computer (IMac): ...
1
vote
2answers
583 views

Resolving pseudo domain name to private IP

Assume I have a VM running on OSX with private IP 10.0.0.1 which can be accessed from the host machine. I was wondering how can I map a pseudo domain, *.app.dev, to the private IP on my host machine ...
0
votes
1answer
2k views

Hostname not changing on Centos 6.4

We have centos machine. We have tried both the /etc/hosts and also /etc/sysconfig/network. Edited both files and service network restart. Yet the hostname is showing as localhost.localdomain. How to ...
2
votes
1answer
208 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
3answers
1k views

How does /etc/hosts match work?

I'm curious about how /etc/hosts entries match works in Linux vs others *nix platform (if there is any difference). In particular I would be interested to understand if "match time" is proportional ...
1
vote
1answer
1k views

Changing the server name

I changed the name of the hosts in /etc/hosts to IP.GOES.HERE newname Apache does recognize the new server name; but still, via ssh i get this on the ssh prompt: [root@oldname] Why? Where else ...
3
votes
1answer
101 views

date format in /etc/hosts.allow

I have following line in my /etc/hosts.allow sshd: 1.2.3.4 : spawn (echo `date` ALLOWED from %a >> /var/log/%d.log) & The problem is, the date command prints time in the standard format, ...