title: How to get the URL or IP of a load balancer from DNS of a website?
body: <blockquote>
    <p>nslookup is a network administration command-line tool available for
    many computer operating systems for querying the Domain Name System
    (DNS) to obtain domain name or IP address mapping or for any other
    specific DNS record.</p>
  </blockquote>
  
  <p>So, nslookup returns the endpoint(s) of a url.
  But if I needs to get the intermediate url/ip, how do I do so?</p>
  
  <p>For eg. If www.example.com is hosted on 2 instances on AWS behind an ELB(Elastic load balancer), then</p>
  
  <pre><code>nslookup www.example.com
  </code></pre>
  
  <p>will return the IPs of the 2 instances. 
  Is there any way to get the dns/ip of the load balancer?</p>
  
  <p>I use the following function in C to resolve a URL to endpoints.</p>
  
  <pre><code>int getaddrinfo(const char *node, const char *service,
                  const struct addrinfo *hints,
                  struct addrinfo **res);
  </code></pre>
  
  <p>Is there a way to get the load balancer's URL/IP in C?</p>