1 /* ----------------------------------------------------------------------- *
3 * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 * Resolve an IP address
19 #include <syslinux/pxe_api.h>
26 uint32_t resolv(const char *name
)
28 return dns_resolv(name
);
31 int main(int argc
, char *argv
[])
37 openconsole(&dev_null_r
, &dev_stdcon_w
);
40 openconsole(&dev_rawcon_r
, &dev_ansiserial_w
);
44 fputs("Usage: resolv hostname\n", stderr
);
51 printf("%s = %u.%u.%u.%u\n", argv
[1],
52 (ip
& 0xff), (ip
>> 8) & 0xff,
53 (ip
>> 16) & 0xff, (ip
>> 24) & 0xff);
55 printf("%s not found\n", argv
[1]);