1dns_ip4(3) Library Functions Manual dns_ip4(3)
2
3
4
6 dns_ip4 - look up IPv4 addresses
7
9 #include <dns.h>
10
11 int dns_ip4(stralloc* out,stralloc* fqdn);
12
14 dns_ip4 looks up 4-byte IP addresses for the fully-qualified domain
15 name in fqdn. It puts the concatenation of the IP addresses into out
16 and returns 0. If the domain does not exist in DNS, or has no IP
17 addresses, out will be empty.
18
19 If dns_ip4 has trouble with the DNS lookup or runs out of memory, it
20 returns -1, setting errno appropriately. It may or may not change out.
21
22 If fqdn is a dotted-decimal IP address, dns_ip4 puts that IP address
23 into out without checking DNS. More generally, if fqdn is a dot-sepa‐
24 rated sequence of dotted-decimal IP addresses, dns_ip4 puts those IP
25 addresses into out without checking DNS. Brackets may appear inside the
26 dotted-decimal IP addresses; they are ignored.
27
29 dns_ip4_packet(3), dns_ip6(3), dns_name4(3)
30
31
32
33 dns_ip4(3)