Skip to content

lib/dns: EINVAL on dns lookup (wrong bind ip for some environment) #42

Description

@lostrepo

I'm getting EINVAL when trying to resolve dns
By changing bind ip

node.bind('127.0.0.1', () => {
from 127.0.0.1 to external interface ip I'm able to resolve dns without errors

Possible solutions I see:

  1. pass bind_ip parameter to lookup method as override
  2. on dns module load save LO_DNS_BIND_IP environment variable as default override
  3. on dns module load use ioctl to find all interface' ips (something like https://stackoverflow.com/a/4139811, https://stackoverflow.com/a/4267204), try to resolve and bind to all ips, save ip that resolved as default override
  4. all/some of the above (priority: 1 > 2 > 3)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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