---
name: "Zonemaster::Engine::ASNLookup"
section: "3pm"
platform: "linux"
package: "libzonemaster-perl"
version: "7.1.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Zonemaster::Engine::ASNLookup"
---

# Zonemaster::Engine::ASNLookup(3pm)

do lookups of ASNs for IP addresses

## NAME

Zonemaster::Engine::ASNLookup - do lookups of ASNs for IP addresses

## SYNOPSIS

```
   my ( $asnref, $prefix, $raw, $ret_code ) = Zonemaster::Engine::ASNLookup->get_with_prefix( '8.8.4.4' );
   my $asnref = Zonemaster::Engine::ASNLookup->get( '192.168.0.1' );
```

## FUNCTION

- get($addr)

  As **get\_with\_prefix()**, except it returns only the list of AS numbers for the address, if any.

- get\_with\_prefix($addr)

  Takes a string (or a Net::IP::XS object) with a single IP address, and does a lookup in either: a) Cymru-style DNS zone or b) RIPE whois server, depending on Zonemaster::Engine::Profile setting "asn\_db{style}".

  Returns a list of a reference to a list of AS numbers, a Net::IP::XS object of the covering prefix for that AS, a string of the raw query, and a string of the return code for that query.
