Skip to content

ares_getnameinfo not working where getnameinfo does #752

@Asmod4n

Description

@Asmod4n

I have a strange issue, running the following code works without an issue.

struct sockaddr_storage ss = {0};
struct sockaddr_in *sa_in = (struct sockaddr_in *) &ss;
inet_pton(AF_INET, "185.199.111.153", &(sa_in->sin_addr));
ss.ss_family = AF_INET;
char host[1024];
char service[20];
getnameinfo((struct sockaddr*)&ss, sizeof ss, host, sizeof host, service, sizeof service, 0);
printf("Host: %s\n", host);

when i am replacing getnameinfo with ares_getnameinfo i am getting the error DNS server does not implement requested operation (ARES_ENOTIMP)

I am running kali linux (rolling release) under wsl 2 on a windows 11 pc, my DNS Server is dnsmasq with unbound with root servers configured. Everything is updated to the latest software.

ares_getaddrinfo works just fine, i have not set any ares_init options except ARES_OPT_SOCK_STATE_CB and its required fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions