I think that with the @LDOMAIN and @HOSTNAME I might be abble to do something quite simple