Context : IRAS20126+4104 is a well studied B0.5 protostar that is surrounded by a \sim 1000 au Keplerian disk and is where a large-scale outflow originates . Both 6.7-GHz CH _ { 3 } OH masers and 22-GHz H _ { 2 } O masers have been detected toward this young stellar object . The CH _ { 3 } OH masers trace the Keplerian disk , while the H _ { 2 } O masers are associated with the surface of the conical jet . Recently , observations of dust polarized emission ( 350 \mu m ) at an angular resolution of 9 arcseconds ( \sim 15000 au ) have revealed an S -shaped morphology of the magnetic field around IRAS20126+4104 . Aims : The observations of polarized maser emissions at milliarcsecond resolution ( \sim 20 au ) can make a crucial contribution to understanding the orientation of the magnetic field close to IRAS20126+4104 . This will allow us to determine whether the magnetic field morphology changes from arcsecond resolution to milliarcsecond resolution . Methods : The European VLBI Network was used to measure the linear polarization and the Zeeman splitting of the 6.7-GHz CH _ { 3 } OH masers toward IRAS20126+4104 . The NRAO Very Long Baseline Array was used to measure the linear polarization and the Zeeman splitting of the 22-GHz H _ { 2 } O masers toward the same region . Results : We detected 26 CH _ { 3 } OH masers and 5 H _ { 2 } O masers at high angular resolution . Linear polarization emission was observed toward three CH _ { 3 } OH masers and toward one H _ { 2 } O maser . Significant Zeeman splitting was measured in one CH _ { 3 } OH maser ( \Delta V _ { Z } = -9.2 \pm 1.4 m s ^ { -1 } ) . No significant ( 5 \sigma ) magnetic field strength was measured using the H _ { 2 } O masers . We found that in IRAS20126+4104 the rotational energy is less than the magnetic energy . Conclusions :