Hi everyone,I'm really at a loss here: Somehow my system seems to ignore the /etc/hosts file completely. Here is a little excerpt from my console that should make the problem clear:[root@deanna etc]# host gerrit.hadiko.de
gerrit.hadiko.de is an alias for vm34.hadiko.de.
vm34.hadiko.de has IPv6 address 2001:7c0:409:8001::32:134
[root@deanna etc]# host doesnotexist.hadiko.de
Host doesnote
I'm going to run rsync in daemon mode on machine 1 to backup data from machine 1 to machine 2. Machine 1 has a static ip address (Fedora 13 for now, until the back up of 2 is complete). Machine 2 uses dhcp (Fedora 17). The only ip address in /etc/hosts on machine 2 is the loopback address.
I'd like to know if it's possible on a debian machine to automatically setup the hosts file of every other computer on the network.
I'd like to be able to connect to the machine using a host name instead of the IP (ssh user@hostname instead of ssh user@192.168.1.10), but I don't want to change manually all the hosts files on the other computers on the network.
korn shell script on Solaris
getent hosts <hostname> returns
IP FQDN
But I just want the output to be like this
<hostname> IP
things I have tried so far
Code:
getent hosts <hostname> |awk '{print $2,$1}'
using awk and substr
Code:
getent hosts <hostname> |nawk '{print substr($2,1,5)}'
using cut command
Code:
getent hosts <hostname> |cut -f2,
The problem is that I fail to SSH to remote machine via hostname(while IP does)
The hostname return by command hostname is : california_desert
While the name returned by command nslookup $IP_address is: pcpp3238782
They did not match each other.
I think that's why I cannot connect to remote machine via hostname.
Checked with /etc/hosts;/etc/hostname; /etc/sysconfig/network; all set hostname t
I have several virtualbox applicances (windows, linux) each of them configured with two network adapters:
NAT for acessing the internet
host-only for hosts <> hosts and hosts <> guest communication
Problem is, I can conly communicate by ip address. I want to communicate by hostname, ie, I want to be able to reach any host from any other host (or guest) by using the hostname.
I want to change the hostname of my computer. I can do it by editing (as root) the files /etc/hostname and /etc/hosts (unless I missed some other important place). But that's ugly. Is there a straightforward way to do it? (The hostname command only modifies your home directory.)
This would be a useful addition to System Settings.
I'm setting up a local network and have configured a DNS server.
I recently began having issues with my Arch box not allowing connections based on hostname. Not sure whats going on I can SSH into the box, view the webserver, ftp, etc assuming I am using the IP address. If I use the hostname, nothing works.I can nslookup from a Windows machine and see the IP is resolved..