File: fdnsip.c

package info (click to toggle)
firedns 0.9.12-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,192 kB
  • ctags: 322
  • sloc: ansic: 4,026; sh: 964; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include "firedns.h"

int main(int argc, char **argv) {
	struct in_addr *result;

	if (argc != 2) {
		fprintf(stderr,"usage: %s <hostname>\n",argv[0]);
		return 2;
	}

	result = firedns_resolveip4(argv[1]);
	if (result) {
		printf("%s\n",firedns_ntoa4(result));
		return 0;
	}

	return 1;
}