Given a square matrix A with entries in a commutative ring S , the ideal of S[X] consisting of polynomials f with f(A)=0 is called the null ideal of A . Very little is known about null ideals of matrices over general commutative rings. First, we determine a certain generating set of the null ideal of a matrix in case is the residue class ring of a principal ideal domain D modulo d∈D. After that we discuss two applications. We compute a decomposition of the S -module S[A] into cyclic S-modules and explain the strong relationship between this decomposition and the determined generating set of the null ideal of A . And finally, we give a rather explicit description of the ring Int(A,Mn(D)) of all integer-valued polynomials on A.