By definition, on the whole internet, host names are public. That is what DNS (dynamic name service or distributed name service) is all about.
If you want to connect to www.google.com, its public. Period.
I would strongly recommend that you do not use RMI for this project. Use HTTP or if you really need security, use HTTPS
See
https://coderanch.com/t/570237/java/java/Why-there-still-interest-lots