Modify the /etc/host file

Hello,

I have a no-ip account and I can access my device from outside my local network typing something like :

http://myname.no-ip.org

However, when I am connected on my LAN this does not work and I have to type http://wdmycloud.local (on my MAC). So I have two adresses that work depending on if I am connected through my local network or the internet.

I want to use only one common adress (and of course it has to be myname.no-ip.org). I understood that I can create and alias by modifying the file /etc/host and adding the following line :

127.0.0.1 myname.no-ip.org

When I restart the networking interface with 

/etc/init.d/networking restart

The /etc/host file goes back to its initial setup which is : 

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

 And of course I cannot reach my NAS by typing myname.no-ip.org :frowning: Did I made something wrong or I am trying to accomplish something impossible?

Thank you.

That’s probably more a question for a Mac forum somewhere than here as it really has nothing specific to do with the My Cloud…

But perhaps a Mac user here will know an answer.

I don’t think that is linked with the os of my system. Whatever the client is, I want to reach the device with the link name.no-ip.org even on my LAN and not just WAN.

Francky17 wrote:
I don’t think that is linked with the os of my system.

Of course it is.   Your system is where the /etc/hosts file would be modified… not the cloud.

I want my cloud to answer to myname.no-ip.org (or whatever what else) instead of wdmycloud.local when I’m connected on the local network. How can that be possibly linked to the clients configuration?

I’m tellin’ya…  the /etc/hosts file is a CLIENT-SIDE configuration.  The CLIENT does the name lookup, not the SERVER.

The SERVER (in this case, the Cloud) only responds to mDNS queries by use of an avahi daemon, which the /etc/hosts file has no control over.

On some linux installations, there might be an avahi.hosts file that can contain multiple hostnames – but the My Cloud doesn’t appear to have one, and I’m not sure if adding one would have any affect.