5 #include <netinet/in.h>
7 #include <syslinux/pxe.h>
9 static inline uint32_t dns_resolve(const char *hostname
)
11 return pxe_dns(hostname
);
14 static inline void usage(const char *s
)
16 fprintf(stderr
, "Usage: %s hostname [, hostname_1, hostname_2, ...]\n", s
);
19 int main(int argc
, char *argv
[])
24 openconsole(&dev_null_r
, &dev_stdcon_w
);
31 for (i
= 1; i
< argc
; i
++) {
32 ip
= dns_resolve(argv
[i
]);
34 printf("%s not found.\n", argv
[i
]);
36 printf("%-39s %08X %u.%u.%u.%u\n", argv
[i
], ntohl(ip
), ip
& 0xFF,
37 (ip
>> 8) & 0xFF, (ip
>> 16) & 0xFF, (ip
>> 24) & 0xFF);