Linux Setting time in NAS (wd my cloud)


netant

Well-Known Member
Adept
Oct 12, 2012
294
110
82
i hope this is the current section to post.

As you know, i had disabled internet in my WD MyCloud a little while ago, by putting a random IP in DNS.

Because of this NTP services are also cut off from internet and the time on the device is not updating after every restart it will reset the time/date to 2016.

is there any way to set time in the wd mycloud via alternate methods such as command via ssh ( i can create a schedule task in PC to run a certain batch command which will set the time of the device)


or i have one more workaround which i extensively use in macOS, by using custom nameserver via dns resolver per domain.

will this methord work in linux ( running the mycloud) ?

if so which will be the location where linux looks for DNS resolver ? (i can see multiple etc/ressolver/ directory )



UPDATE:

in-fact, unix DNS ressolver doesnt work like macOS.
dnsmasq is not an option for this device as the memory, etc limits.

what worked form me is :-
i have hard coded the hostname-to-IP mappings, now my cloud is not longer has to consult DNS for resolving the hostname.

this can be done by entering below lines in /etc/hosts
Code:
188.166.215.214  pool.ntp.org
this above example is for my NTP server which i use - pool.ntp.org
 
Last edited:

vivek.krishnan

If you cant see the green dot, I'm offline :P
Veteran
Dec 18, 2009
7,458
1,670
253
Ghatkopar, Mumbai
plus.google.com
i hope this is the current section to post.

As you know, i had disabled internet in my WD MyCloud a little while ago, by putting a random IP in DNS.

Because of this NTP services are also cut off from internet and the time on the device is not updating after every restart it will reset the time/date to 2016.

is there any way to set time in the wd mycloud via alternate methods such as command via ssh ( i can create a schedule task in PC to run a certain batch command which will set the time of the device)

or i have one more workaround which i extensively use in macOS, by using custom nameserver via dns resolver per domain.

wil this methord work in linux ( running the mycloud) ?

if so which will be the location where linux looks for DNS resolver ? (i can see multiple etc/ressolver/ directory )
It should work, you need to check the resolver and whether it supports - mostly yes.

Alternatively, DNS blocking of internet is not the best way - many systems do have hardcoded IPs.
 

netant

Well-Known Member
Adept
Oct 12, 2012
294
110
82
Alternatively, DNS blocking of internet is not the best way - many systems do have hardcoded IPs.
looks like my cloud don't use any hard-coded DNS, as after putting fake dns, it stopped updating time and it stopped looking for software updates.

just for my knowledge, what could be the other way to block internet in my cloud, i know it could be via router - but my router running in stock firmware which don't have option to "allow LAN only" for any device, upgrading to ddwrt will be hell lot of task to reconfigure my entire home network .
 

vivek.krishnan

If you cant see the green dot, I'm offline :P
Veteran
Dec 18, 2009
7,458
1,670
253
Ghatkopar, Mumbai
plus.google.com
looks like my cloud don't use any hard-coded DNS, as after putting fake dns, it stopped updating time and it stopped looking for software updates.

just for my knowledge, what could be the other way to block internet in my cloud, i know it could be via router - but my router running in stock firmware which don't have option to "allow LAN only" for any device, upgrading to ddwrt will be hell lot of task to reconfigure my entire home network .
Not hardcoded DNS - I am talking about phone home IPs.

Blocking via router is the best, as that is edge case.

For doing custom NS and etc - you need to jailbreak/get SSH access to your device and do the needful by looking at the backend.
 

6pack

Well-Known Member
ex-Mod
Sep 19, 2005
7,558
1,544
302
why do you need to stop internet for the wd? isn't the router nat more than enough? try to stop the wd from forwarding ports in the router.
doesn't the wd have a firewall or something to block outside infiltration?
 

netant

Well-Known Member
Adept
Oct 12, 2012
294
110
82
why do you need to stop internet for the wd? isn't the router nat more than enough? try to stop the wd from forwarding ports in the router.
doesn't the wd have a firewall or something to block outside infiltration?
im still running stock firmware in my router, waiting for openwrt updates then im going to flash in a week or two .
touching anything in the router firewall defaults is disturbing my home network.

WD doesn't have anything such, it wide open to public. the only option is to stop cloud access. Enabling cloud mean anyone from internet can access.
it one of the most insecure device. every device is profiled at their WD website once we give lan access to it for a phone, even if he is not in my network he can access. ( i was shocked to know this, when i configure my brother's phone as guest to access it when he was in my home network. But he was still able to access from 1000km away via mobile network).
 
  • Like
Reactions: 6pack

6pack

Well-Known Member
ex-Mod
Sep 19, 2005
7,558
1,544
302
well, that's really bad. what a stupid device by WD. even one compromised device on a network is enough for virus to propagate.
 

netant

Well-Known Member
Adept
Oct 12, 2012
294
110
82
I bought that when i had limited budget, and it was freshly launched, so not much information available for these devices back then.
plus this is a single drive NAS with no redundancy. I will buy a 2 bay Synology in couple of years down the lane until than i have to use this and it serving the purpose.
 

netant

Well-Known Member
Adept
Oct 12, 2012
294
110
82
UPDATE:

in-fact, unix DNS ressolver doesnt work like macOS.
dnsmasq is not an option for this device as the memory, etc limits.

what worked form me is :-
i have hard coded the hostname-to-IP mappings, now my cloud is not longer has to consult DNS for resolving the hostname.

this can be done by entering below lines in /etc/hosts
Code:
188.166.215.214  pool.ntp.org
this above example is for my NTP server which i use - pool.ntp.org
This need an another update based on my new learning.
ntp.org - is not recommended as those IP address are not static & can change in future.
Seems like this services has now migrated as dynamic IP range. for example pool.ntp.org can now resolve to multiple addresses: at present their IP addresses are - 162.159.200.123, 210.23.25.77, 103.47.76.177, 162.159.200.1
This update and multiple IP is in effect from 14/October/2019 and can no longer be used to set static NTP services.

Solution:
migrated old NTP services to NIST (nist.gov) - They use static IP and has IP4 as well as IP6 Static addresses.

Code:
utcnist2.colorado.edu    128.138.141.172
time-e-b.nist.gov        132.163.96.6
time-e-b.nist.gov        2610:20:6f96:96::6
are few of their sample servers.