Sounds like the perfect job for the Stream feature. You can use a Profile or an iRule to do this, specifying the wrong hostname as the search string and the correct one as the replacement string. I'd got for the iRule myself. Strangely I can't find an example that doesn't use HTTP nor any details on what events might be valid. However, my VE certainly accepts this;
You must assign a Stream profile (with no source or target strings
specified) to the Virtual Server before you can use this iRule
Escape periods with a backslash where possible
The stream expression must always come before stream is enabled
when CLIENT_DATA {
We don’t want to rewrite requests, only responses
STREAM::disable
}
when SERVER_DATA {
Search for instances of wronghost and replace with righthost
@ Is a delimiter at the start and end of each string
STREAM::expression {@wronghost@righthost@}
Apply and rewrite response data
STREAM::enable
}