From PhilPapers forum Metaphysics:

2009-11-19
Two-Dimensional Semantics
Reply to Robin Robin
If w were the actual world, then the term "water" would rigidly designate XYZ.  So yes, when considering counterfactuals with w considered as actual, "water" denotes XYZ.