package Shodan::API::DNS;

=head1 NAME

Shodan::API::DNS

=cut

BEGIN {
    use FindBin qw($Bin);
    use lib "$Bin/../../../lib";
}

use strict;
use warnings;
use parent 'Shodan::API';
use Shodan::DataValidation;

sub resolve {
    return shift->call_api({
        'arguments'    => shift || {},
        'request_uri'  => '/dns/resolve',
        'request_type' => 'GET',
        'required'     => {
            'hostnames' => [
                'format' => 'csv',
                'types'  => [
                   'hostname',
                   'ipv4',
                   'ipv6',
               ]
           ]
        },
    });
}

sub reverse {
    return shift->call_api({
        'arguments'    => shift || {},
        'request_uri'  => '/dns/reverse',
        'request_type' => 'GET',
        'required'     => {
            'ips' => {
                'format' => 'csv',
                'types'  => [
                    'ipv4',
                    'ipv6',
                ],
            }, 
        },
    });
}

1;
