We consider the generation of magnetic field by the flow of a fluid for which the electrical conductivity is nonuniform. A new amplification mechanism is found which leads to dynamo action for flows much simpler than those considered so far. In particular, the fluctuations of the electrical conductivity provide a way to bypass anti-dynamo theorems. For astrophysical objects, we show through three-dimensional global numerical simulations that the temperature-driven fluctuations of the electrical conductivity can amplify an otherwise decaying large scale equatorial dipolar field. This effect could play a role for the generation of the unusually tilted magnetic field of the iced giants Neptune and Uranus. 45.70.Mg The current explanation for the existence of magnetic field in astrophysical objects was given in 1919 by Larmor [1]. The motion of an electrically conducting fluid amplifies a seed of magnetic field by induction: this is the dynamo instability. Despite nearly hundred years of research, several questions remain open. One of the reasons is that for a flow to be dynamo active, it has to be complex enough.For instance, for a fluid with uniform physical properties, planar flows cannot create magnetic fields [2]. This result together with other similar anti-dynamo theorems [3], severely constrain the structure of the flows that can act as dynamos. Broadly speaking, both the flow and the resulting magnetic field must be complex enough.In an astrophysical object, considering the electrical conductivity σ as a constant is a very crude simplification. In most natural situations (liquid core of planetary dynamos, plasmas of stellar convection zones, galaxies), the temperature T , the chemical compositions C i and the density of the fluid ρ are expected to display large variations. As a result the electrical conductivity of the fluid is unlikely to remain uniform in the bulk of the flow. In other words, σ , that is determined by ρ, T and C i can be written as a function of space and time σ (r,t) because ρ, T and C i are functions of space and time. The effect of a boundary of varying conductivity close to a flow tangent to the boundary had been considered to model inhomogeneities of the Earth mantle [4]. A dynamo instability has been predicted but requires a flow with a huge velocity [5]. In this article we describe how magnetic field generation is affected by conductivity variations in the bulk of the fluid.To calculate this effect, we have to take into account that σ depends on position in the equation for the magnetic field that readsInsight can be obtained using the approximation of scale separation. We assume that the velocity and conductivity fields are periodic of period l. We note · the spatial average over l. Let the magnetic diffusivity be η = (µ 0 σ ) −1 = η 0 + δ η, where η 0 is the mean of η and δ η its variations. We write B = B + b and consider that B varies on a very large scale compared to l. In this limit, B satisfies a mean-field (closed) equation that readswhere α B is the sum of two terms,Pr...