3

Scanning the machine on the LAN with my laptop, I got this:

gabriele @ osiris { ~ } [ Tue Oct 07 ] [ 08:49 PM]
 nmap -sP 192.168.1.236

Starting Nmap 6.40 ( http://nmap.org ) at 2014-10-07 20:50 CEST
Nmap scan report for ---.homenet.telecomitalia.it (192.168.1.236)
Host is up (0.0044s latency).
Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds

nmap won't recognize the nostname, putting—in place of "mercury" and I assume is not a problem of nmap because it doesn't even access in this way:

root@mercury

when I changed the hostname I follow these steps

sudo nano /etc/hostname

and I wrote a single line with "mercury", then:

sudo nano /etc/hosts

with this configuration:

127.0.0.1       localhost
127.0.1.1       mercury localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

and finally:

sudo /etc/init.d/hostname.sh start

am I doing something wrong?

1 Answers1

0

change ur /etc/hosts file from

127.0.0.1 localhost

127.0.1.1 mercury localhost

to:

127.0.0.1 localhost

192.168.1.236 mercury

once you do that, "ping mercury" or "nmap mercury" should work, and the inverse, "nmap 192.168.1.236" should then show the hostname associated with that IP in /etc/hosts, in the nmap report output

nandoP
  • 416
  • 2
  • 3