For any prime power q we determine a polynomial fq(X) in Fq(t,u)[X] whose Galois group over Fq(t,u) is the Dickson group G2(q). The construction uses a criterion and a method due to Matzat.