We present a series of electron spin resonance ͑ESR͒ and infrared transmission experiments in antiferromagnetic ͑AF͒, lightly hole-doped YBa 2 Cu 3 O 6 in search for the effect of a spatially inhomogeneous ground state on the magnetic and electric properties. Crystal compositions were Ca x Gd y Y 1−x−y Ba 2 Cu 3 O 6 with x =0, 0.008, 0.02, and 0.03 and y Ϸ 0.01. Gd 3+ ESR satellites from sites with first-neighbor Ca atoms show that holes are not preferentially localized at low temperatures in the vicinity of Ca dopants. We mapped by multifrequency Gd 3+ ESR the AF domain structure as a function of hole concentration, temperature, and magnetic fields up to 8 T. We attribute the hole-doping-induced rotation of the magnetic easy axis from collateral to diagonal ͑with respect to the tetragonal CuO 2 lattice͒ to the pinning of the AF magnetization to a static modulation or a phase-separated network of the hole density. The dominantly fourfold symmetry of pinning suggests that the hole density network has this symmetry also and is not an array of stripes. At higher temperatures the pinning to the diagonal direction becomes weak and the possibility of domain wall fluctuations is discussed. There is no magnetic field dependence and no in-plane anisotropy of the infrared transmission polarized in the CuO 2 planes in an x = 0.02 crystal placed in magnetic fields up to 12 T. Thus, the network of holes is rigid and is not affected by magnetic fields that are, however, strong enough to rotate the AF magnetization into a single domain.