I have a small computer at home which I want to use as a home server with YunoHost. Since the machine is at home it will have a dynamic IP, so I need to set up dynamic DNS for it. As far as I understand the YunoHost documentation I need to sign up with a DDNS provider, then point my existing domain to the IP of the provider’s servers, then set up my server to periodically inform the DDNS provider about its current IP.
This got me thinking: could the DDNS provider lie to the public? Let’s say I’m at my laptop and I execute ssh johndoe@mydomain.com. My laptop connects to the internet and needs to look up the IP behind mydomain.com. The names resolved to the IP of the DDNS provider. However, the provider instead of just forwarding the request to my server intercepts it and then forwards it. Basically a man-in-the-middle attack. When my server confirms the credentials and reports back the attacker will know that whatever I just entered are my valid credentials and thus have access to the server.
Is this a realistic attack scenario or am I mistaken about how DDNS works? If it’s the former, would it be possible to host my own DDNS server? I already have a VPS with YunoHost running at a stable IP, so I could use that as the VPS provider for my home server. If I were to use one of the automatic domains provided by YunoHost (e.g. nohost.me) would I still need to set up a DDNS provider or would that get taken care of automatically?