In the DNA backbone, which bonds exactly are considered ester bonds? Following are the three different answers to this question that I reached by googling. Which of them is right?


The covalent bond between the 3' C and the O, and the covalent bond between the 5' C and the O:



2. The covalent bond between the P and the O that is bonded to the 5' C, and the covalent bond between the P and the O that is bonded to the 3' C (deduced from the following image):


3. The -O- (two covalent bonds with an O) that link between the P and the 5' C, and the -O- that link between the P and the 3' C (deduced from the following image):


Maybe my confusion stems from a more general misunderstanding:
When two alcohols are linked through an ester linkage (i.e., both OH groups are replaced with an -O-), we get R1-O-R2. In this case, do we say that each of the covalent bonds with the O is an ester bond? Or is the whole -O- considered a single ester bond?

(Note that I am not asking what exactly a phosphodiester bond is, which is (if I understand correctly) everything that connects the 5' C and the 3' C of adjacent nucleotides.)
All of them are right, regarding ester bonds themselves. But only one of them is right, regarding DNA context. AMP/ADP/ATP/GMP are based on ribose ( see RNA ), not on deoxyribose ( DNA ).
Phosphoric acid has 2 ester bonds in DNA.
You have somehow confused an ester and an ether bond.
$\ce{R_1-O-R_2}$ is an ether bond,
$\ce{R-O-X}$ is an ester bond, where $\ce{X}$ is a carbonyl ( from carboxylic acids or carbonic acid ) or some nonmetal like $\ce{S}$ or $\ce{P}$ for esters of inorganic acids like $\ce{(CH3O)2SO2}$.
If we are to consider it as a bond or a group depends on the point of view. It is both.
It is a group, if we focus on the $\ce{CO-O}$ atom group of esters of organic acids or $\ce{O}$ for mineral acid esters.
It is a bond ( or a bridge ), if we focus on what the group connects.