Error when try connect postgres

I have set up all at fly.io, and everything is up except the database connection when I try to make a query.

*omit the username and password

{"level":"error","message":"Uncaught error, responding with 500 for url /api/contacts: getaddrinfo ENOTFOUND postgres://*****:*****@top2.nearest.of.phone-book-app-db.internal:5432/phone_book_app","stack":"Error: getaddrinfo ENOTFOUND postgres://*********:******@top2.nearest.of.phone-book-app-db.internal:5432/phone_book_app\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:26)","e":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"postgres://********:********@top2.nearest.of.phone-book-app-db.internal:5432/phone_book_app"},"typeofE":"object"}