Host variables into script on LXC

I am trying to write a script to be executed in a container, but I need to reference the hostname of the actual host and not the container.

echo $HOSTNAME prints the hostname of the container and not of the actual host that I’ve SSH’d to. How can I make the container aware of the host variables like hostname and IP address?

Maybe you could write a script, so the host writes the information into a file inside the container and the container can read that file out.

But I don’t really see the usecase.