'Boost asio Error: Host not found (non-authoritative), try again later

i need this solution with c++. Example txt is here "www.asd.com/try.txt" i need read from txt. I have an error Error: Host not found (non-authoritative), try again later. What is my mistake? (website and path are true "asd" is just example)

my code:

#include <iostream>
#include <string>
#include <boost/asio.hpp>
int main()
{
    boost::asio::ip::tcp::iostream stream;
    stream.connect("www.asd.com", "http");
    if (!stream)
    {
        std::cout << "Error: " << stream.error().message() << "\n";
    }
    stream << "GET /ip.txt HTTP/1.0\r\n\r\n";
    stream << "Host: www.asd.com\r\n";
    stream << "Accept: */*\r\n";
    stream << "Connection: close\r\n\r\n";

    for (std::string line; getline(stream, line);)
    {
        std::cout << line << std::endl;
    }
}


Solution 1:[1]

It means the domain (or service) cannot be resolved to an endpoint.

That domain is www.asd.com here, and the service is http. Both resolve on my machine, but it depends on your host: e.g. in some settings (containers?) there might not be any DNS resolver configured.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sehe