I didn't know they were relying on the Agent to set the hostname.
I really tried to replicate the code done in python, in which there is the possibility to change the hostname.
But I that was a question for me since it's not possible to do so via the API
http://docs.datadoghq.com/api/

I don't know what would be the best choice here