My site appears in results as domain name AND later as ip address

Hi.
My site appears first in search results for a given search term and then appears again further down but on that listing it appears without the domain name, just the ip address. It’s happening on google and duckduck. Why is this happening? Is it a problem? and if so, how do I fix it?

Thanks in advance for your answer(s)

Do you have a sitemap.xml or some kind of search engine page that the search engine is indexing from? Does that file include your IP address as links to index? Do you have other sites that are reaching you through IP links instead of the domain? For instance, was your site without a domain name for a while where the only way people reached it was through an IP?

If a search engine sees a link with your IP as the host and going through that link and your site honors the IP address by showing a page, the search engine never thinks to look up related domain names. It just indexes the IP.