Let D be a Krull domain admitting a prime element with finite residue field and let K be its quotient field. We show that for all positive integers k and 1<n1≤⋯≤nk\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$1 < n_1 \\le \\cdots \\le n_k$$\\end{document}, there exists an integer-valued polynomial on D, that is, an element of Int(D)={f∈K[X]∣f(D)⊆D}\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$${{\\,\ extrm{Int}\\,}}(D) = \\{ f \\in K[X] \\mid f(D) \\subseteq D \\}$$\\end{document}, which has precisely k essentially different factorizations into irreducible elements of Int(D)\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$${{\\,\ extrm{Int}\\,}}(D)$$\\end{document} whose lengths are exactly n1,…,nk\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$n_1, \\ldots , n_k$$\\end{document}. Using this, we characterize lengths of factorizations when D is a unique factorization domain and therefore also in case D is a discrete valuation domain. This solves an open problem proposed by Cahen, Fontana, Frisch, and Glaz.