Change hostname setter to only fetch the hostname once.