We analyze the Gribov problem for SU(N) and U(N) Yang-Mills fields on
d-dimensional tori, d = 2,3,.... We give an improved version of the ax
ial gauge condition and find an infinite, discrete group G' = Z(dr) ??
(Z(2)(N-1) ?? Z(2)) where r = N-1 and N for ($) under bar G = SU(N) a
nd U(N) respectively, containing all gauge transformations compatible
with that condition. This residual gauge group G' provides all Gribov
copies for nondegenerate configurations in d = 2 and for those of them
for which all winding numbers of the Wilson-Polyakov loop in one dire
ction vanish in d greater than or equal to 3. This shows that the spac
e of gauge orbits is an orbifold. We derive this result both in the La
grangian and in the Hamiltonian framework.