0

My hostname was smit-Aspire-5742 but now whenever I type sudo fing

it gives the following output

smit@smit-Aspire-5742:~$ sudo fing
[sudo] password for smit: 
16:00:07 > Discovery profile: Default discovery profile
16:00:07 > Discovery class:   data-link (data-link layer)
16:00:07 > Discovery on:      192.168.1.0/24

16:00:07 > Discovery round starting.
16:00:07 > Host is up:   192.168.1.2
     HW Address:   4C:0F:6E:3D:13:87 (Hon Hai Precision)
     Hostname:     Sanskruti-PC.Home

16:00:07 > Host is up:   192.168.1.1
     HW Address:   AC:F1:DF:E6:DB:5D
     Hostname:     D-Link.Home

16:00:07 > Host is up:   192.168.1.3
     HW Address:   C8:3A:35:CF:97:E9 (Tenda Technology)
     Hostname:     Shivai-Desktop.Home

16:00:08 > Discovery progress 25%
16:00:09 > Discovery progress 50%
^C16:00:09 > Discovery stopped

This is my laptop showing my hostname as Sanskruti-PC.Home.

   HW Address:   4C:0F:6E:3D:13:87 (Hon Hai Precision)
       Hostname:  Sanskruti-PC.Home

It was showing me correct hostname until my sister log in into the windows which duel booted with Ubuntu.I had tried everything on these links :-

How do I change the hostname without a restart?

How do I change the computer name?

I Also changed the computer name in windows from Sanskruti-PC.Home to smit-Aspire-5742 but nothing is happening.

here is output of my hostname command

smit-Aspire-5742

Is this a problem with hostname or fing?

output of the command nslookup Sanskruti-PC.Home

  smit@smit-Aspire-5742:~$ nslookup Sanskruti-PC.Home
  Server:       127.0.0.1
  Address:  127.0.0.1#53

  Non-authoritative answer:
  Name: Sanskruti-PC.Home
  Address: 192.168.1.2

And output command nslookup smit-Aspire-5742

  smit@smit-Aspire-5742:~$ nslookup smit-Aspire-5742
  Server:       127.0.0.1
  Address:  127.0.0.1#53

  Name: smit-Aspire-5742
  Address: 127.0.1.1
  • Sounds to me like an issue with your dns having cached that name. Try clearing it and retry your request. – Ziazis Jul 06 '17 at 11:54
  • @Ziazis I Had tried to clean the dns cache like the way told here https://www.cyberciti.biz/faq/rhel-debian-ubuntu-flush-clear-dns-cache/ but ,i am getting the same result.please can you tell me how can I clear that name?? –  Jul 06 '17 at 12:27
  • What do you get if you type in, nslookup smit-Aspire-5742 and nslookup Sanskruti-PC.Home, it could also be the cache of fing having saved your MAC address under the .home name. – Ziazis Jul 06 '17 at 12:41
  • @Ziazis I have posted the output of your command in question by editing it.Please take a look at it. –  Jul 06 '17 at 12:53
  • 1
    Look into your /etc/hosts and adjust the name there if it is set incorrectly. – Ziazis Jul 06 '17 at 12:53
  • @Ziazis thanks I have edited my file /etc/hosts.I just replace the ip address 127.0.1.1 with 192.168.1.2 and now I am getting correct hostname!!You should post it as answer so I can accept it! –  Jul 06 '17 at 12:59
  • Don't replace that address... add a new line for it. – Ziazis Jul 06 '17 at 12:59
  • @Ziazis can you join in chat?? (If you are free) –  Jul 06 '17 at 13:01

1 Answers1

0

I have added Line 192.168.1.2 smit-Aspire-5742 in My /etc/hosts