Q:

How do Kripke's rigid designators and the necessity of identity relate to the Duhem-Quine thesis?

The Duhem-Quine thesis refers to the underdetermination of scientific theories and the fact that it is impossible to test scientific theories in isolation, we always need to make background assumptions when making empirical observations. 
It seems to me that this implies in a way that all truths are contingent, since any statement is true only with regards to the background theories and assumptions that were made when stating it. Quine in particular, questioned the analytic-synthetic distinction, and argued that even the rules of logic might be relative.  
But then doesn't this contradict Kripke's concept of rigid designators, and his result that identity relations are necessary truths, not contingent ones? 
If everything is theory laden, then Water == H2O only with regards to some theories, and we don't even have to look for other planets, it possible that Water != H2O right here at home, as long as we have the right theoretical framework. 
How can there be rigid designators at all, if everything is ultimately dependent on background theories and assumptions? 

A:

They are in opposition, as Quine and Kripke generally are on interpreting modal logic, and much of what is related to it. Rigid designators are defined as those picking out the same object in all possible worlds, so unsurprisingly Quine and Kripke do not see eye to eye on this issue in particular. To pick out the same object we must agree on how it is done, obviously we want some things to be different in different worlds, so what would the sameness cover? According to Kripke, there are some naturally existing (not theory dependent) "essences" that stay the same, e.g.  being human is part of Nixon's essence, but being president is not, being H20 is water's essence, but being present in comets is not. This is how the evening star becomes identical to the morning star necessarily, both designations are seen as pointing past contingent descriptions to the common essence of Venus.
How do we decide what constitutes an essence? "Consult your metaphysical intuitions", as Almog put it in Naming without Necessity. In Naming and Necessity Kripke introduces something called "metaphysical possibility", and argues that it is "intuitive" to many people. So it is metaphysically possible that Nixon lost the 1968 election, but not that he is an alien, possible that Earth is not overflowing with water, but not that  water is not H20, that much is a posteriori necessary (after the chemical composition was discovered). 
The idea is that essences of "natural kinds" (Mill's term resurrected by Russell in 1948) like water are discovered by science, and reflect truths about reality. This is even more controversial than Kripke's modal metaphysics for proper names, see e.g. Ben-Yami's recent critique in Semantics of Kind Terms.
Quine anticipated this approach in Reference and Modality over 20 years before it was fully developed by Kripke, and dismissed it outright:

"...the way to do quantified modal logic if at all is to accept Aristotelian essentialism. To defend Aristotelian essentialism is not however part of my plan. Such a philosophy is as unreasonable by my lights as it is by Carnap's or Lewis's. And in conclusion I say as Carnap and Lewis have not: so much the worse for quantified modal logic. By implication, so much the worse for unquantified modal logic as well..." 

Quine did not close the door on modal logic entirely. But he favored possibility and necessity understood in terms of physical (i.e. theory dependent) conditions specified explicitly, rather than metaphysically intuited. Such approaches were developed in recent decades, see Is there modal logic without possible worlds?
An engaging historical survey of Kripke's development of modal metaphysics as a response to Quine's technical and philosophical objections to modal logic is Tuboly's Quine and Quantified Modal Logic.

