---
name: "firedns_dnsbl_lookup"
section: "3"
platform: "linux"
package: "libfiredns-dev"
version: "0.9.12+dfsg-1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/firedns_dnsbl_lookup"
---

# firedns\_dnsbl\_lookup(3)

Create a query to look up an IP in a DNS-based blacklist

## NAME

firedns\_dnsbl\_lookup - Create a query to look up an IP in a DNS-based blacklist

## SYNOPSIS

**#include \<firedns.h\>**\
 **-lfiredns**

**int firedns\_dnsbl\_lookup(const struct in\_addr \****ip***, const char \* const** *name***)**

## DESCRIPTION

firedns\_dnsbl\_lookup() creates and sends a request to resolve the TXT record of the entry of *ip* in the DNS-based blacklist *name*. It returns a file descriptor that should be [*select*(2)](/select/2.md)'ed upon (read set).  When the file descriptor shows ready for reading call [*firedns\_getresult*(3)](/firedns_getresult/3.md) to retrieve the results.  The result will be a **char \*** with the message from the listing server, or **NULL** if the IP address is not listed.

## RETURN VALUE

Returns an integer file descriptor that can be used the same as any other file descriptor.  Returns *-1* on error.

## AUTHOR

Ian Gulliver \<ian@penguinhosting.net\>

## SEE ALSO

[**libfiredns**(3)](/libfiredns/3.md), [**firedns\_getresult**(3)](/firedns_getresult/3.md), [**select**(2)](/select/2.md)
