Is there a way to resolve DNS at server (using PHP), then include that pre-resolved IP address with domain name in html? So client's browser fetches directly from that IP without having a need to resolve DNS first?
Here is a bit more clarification. My PHP generated page has many external links to js, css and image files from different domains. It takes much time when DNS is resolved on clients' browsers. It can be done very fast on server but I don't want to links those resources directly from IP address. Instead I want something that tells browser that the domain example.com is hosted at 1.1.1.1 for example and no need to perform a DNS lookup.
Is it possible? or can there be a workaround?
Some thing like dns-prefetch with a value or attribute?
<link rel="dns-prefetch" href="http://example.com" value="1.1.1.1" />
Thanks in advance.
Well, you can resolve dns-name to IP.
Your DNS-server IP you can find in your config.