Tagged Questions

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

learn more… | top users | synonyms

1
vote
1answer
24 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
33 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
43 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
89 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
33 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
96 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
368 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
61 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
90 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
51 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
223 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
154 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
471 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
129 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 ...
6
votes
2answers
320 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
23 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
126 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
219 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 # ...
1
vote
1answer
3k 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
177 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 ...
0
votes
0answers
55 views

How do I solve rcp errors on Solaris?

I am using Sun Solaris7 for running my ucam software, and I need to load data from my ucam system to one of my plotters that is also running on Solaris 7. When I load the job I am getting the ...
1
vote
2answers
619 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
372 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
126 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
32 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
182 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 ...
5
votes
2answers
4k 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
1k 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
136 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
335 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
116 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 ...
3
votes
3answers
990 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
778 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
86 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, ...
8
votes
5answers
1k 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 ...
4
votes
1answer
162 views

Alternative to DNS for internal servers

I am setting up my first network at work. All the servers are running CentOS 6.3 and have statically assigned IP addresses. For example: server1 192.168.0.101 server2 192.168.0.102 I want to be ...
6
votes
2answers
6k views

/etc/hosts file refer to another configuration file

How can I get the /etc/hosts file to refer to another configuration file for it's list of hosts? Example /etc/hosts: ## My Hosts 127.0.0.1 localhost 255.255.255.255 broadcasthost #Other ...
4
votes
2answers
6k views

Creating alias to domain name with /etc/hosts

I have a domain setup to point to my LAN's external IP using dynamic DNS, because my external IP address changes frequently. However, I want to create an alias to this host, so I can access it with ...
2
votes
1answer
1k 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 ...
11
votes
1answer
4k views

How can I override the /etc/hosts file at user level? [duplicate]

Possible Duplicate: Can I create a user-specific hosts file to complement /etc/hosts? In short: I would like to know if it is possible to get a ~/hosts file that could override the ...
0
votes
1answer
117 views

Redirecting head output for update hosts file [duplicate]

Possible Duplicate: How can I make iconv replace the input file with the converted output? I'm writing a script to change the content of my hosts file but I got stuck on the head output ...
9
votes
1answer
993 views

Why does SSH not consult /etc/hosts?

I'm administrating a networked environment where the users authenticate over NIS. All machines can be used to SSH into the server but one. On the machine in question, I get the message ssh: connect ...
1
vote
2answers
99 views

Is there some kind kind of hosts.additional file for Linux

If you have a list of servers all linking to each other by static addresses, is there some kind of hosts.additional you can use as some kind of file based DNS? ie The hosts file contains static ...
1
vote
1answer
415 views

Changing host file in Ubuntu

I tried to change /etc/hosts to change a local DNS entry, so I can map any website name to any IP, but it isn't working. How can I debug it?
2
votes
0answers
176 views

why is FQDN using external IP address

When postfix connects to the FQDN dur.bounceme.net it uses the external IP address: root@dur:~# root@dur:~# tail /var/log/mail.log Aug 28 04:39:45 dur postfix/master[6667]: terminating on signal 15 ...
10
votes
2answers
972 views

Two different /etc/hosts depending upon the time

I am trying to make a productivity suite for myself. My first goal is to block Facebook, Gmail and Stackexchange from 0900 to 1600. As of now, I have edited my /etc/hosts and added 0.0.0.0 ...
3
votes
2answers
9k 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 ...