Changing Hostname make Samba share not work in Windows

I installed DietPi on my Raspberry Pi 5, then installed Samba so that I can share data with Windows PCs. In Windows, manually entering the IP address allows me to see shared folders and get into them just fine, but when browsing Networks, it doesn’t show. After some research, I found out about wsdd and installed it. That made DietPi show up in Networks and everything worked.

However, I don’t want to call it DIETPI when browsing Networks. So I go into DietPi and change the Hostname to something else, then reboot. In Windows Networks, it shows up under the new name and I can click into it to see the shared folders, but when I try to get into the folder, it says it’s not available. If I switch the Hostname back to DietPi, it works fine.

I’ve tried reinstalling DietPi and changing the Hostname at install, but it’s still the same problem.

I’ve tried running DietPi in a VM on Windows, and it works just fine, so it must be something about the Pi?

I used to have OpenMediaVault on the same Pi and didn’t have this problem.

I’m running out of ideas and could use some help.

Thanks in advance!

and how does it behaves using IP address only after hostname has been changed?

The name must be changed in smb.conf, not in Hostname.

1 Like

Actually, the hostname is not specified directly in our smb.conf DietPi/.conf/dps_96/conf at 127960eb9d6bb6332e76643b6224d368dc1a447c · MichaIng/DietPi · GitHub

It seems to have more to do with the resolution of the host name.

Normally you could also try to enter \\<hostname> in Windows Explorer. This should hopefully work.

Right, I was remembering a generic configuration where you can use the hostname for server identification.