Get subdomain name from an url

i want to get Url from web Browser (Vaadin 7)
my Server support sub domain , Url format : subdomain.applicationName.com
example : http://private.myapp.com , http://public.myapp.com

i use the method Page.getCurrent().getLocation() to read Url from Web browser but the returned value is

http://32.186.55.179/myapp ==> i dont know why server return Ip adreess instead domain Name

i want a way to read the value of sub domain entered in the Url

example : Url browser http://private.myapp.com => result =private