I have a Raspberry Pi which used to run Linux Kali and that had a hostname of Sid_KaliPi. I later on formatted the SD card and installed Raspbian Jesse and changed the hostname to LDB_Pi. I then installed Webmin. Once installed it said that I have to go onto Sid_KaliPi.local:10000 to access the web interface. After receiving this message, I was slightly baffled.

Is there a way to fix this?

Pls, change the tag accordingly, I haven't got enough reputation to do so, thanks!


| improve this question | | | | |
  • Are you connecting to the Pi from another machine? If so the hostname is likely cached by either the other computer or by your router. To confirm this what is the output from hostname when run on your Pi? – Steve Robillard Dec 3 '16 at 0:00
  • Yeah, I am connecting through ssh from my laptop... is there a way to delete the cache from the router? – SidS Dec 3 '16 at 9:56
  • You will have to google for your specific router, or computer (OS), there are far to many possibilities. – Steve Robillard Dec 3 '16 at 18:13

Steps to verify/edit hostname of raspberry pi (Raspbian Jesse)

  1. Login in to your raspberry pi and type hostname command on the terminal. This should return you the current hostname of the pi.

How to change the hostname. I am using 'Raspbian - 4.4.34+'

1. sudo vi /etc/hostname
    a. Delete the existing hostname
    b. Add the new hostname of the choice. (I am giving this as newHostName)
    c. Save the file and quit.

2. sudo /etc/init.d/hostname.sh
3. hostname

This should return the new hostname of raspberry pi. In this case the output would be newHostName

Also try using command uname-a. The result should be

Linux newHostName 4.4.34+ #930 Wed Nov 23 15:12:30 GMT 2016 armv6l GNU/Linux

| improve this answer | | | | |
  • 1
    This is a good answer to what I think is the wong question. The OP says he formatted and installed Raspbian which should have changed the hostname - I have a feeling the name is cached by his conputer or router. – Steve Robillard Dec 3 '16 at 2:21
  • @SteveRobillard Yeah that's true. Otherwise it should never point to the older hostname. cache needs to be cleared on the browser. I think if he still get the issue he needs to try from a different smart device/computer and see if he is able to access with the new hostname. If the issue still exists then as you said he may have to reboot the router. That should do the fix. – Varad A G Dec 3 '16 at 2:25
  • I don't really think it's cached by the computer, it might be cached from the router, is there a way to clear this cache? – SidS Dec 3 '16 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.