Skip to content

Cannot connect to Redis server on .local domain #1472

@danthe1st

Description

@danthe1st
  • Version:
    Redis version: 3.0.504
    Node Redis: 2.8.0
  • Platform:
    NodeJS v10.15.2 on WSL 2(Ubuntu 19.10 on Windows 10 x86_64 / 4.19.43-microsoft-standard)
    Redis on Windows 10 (Microsoft Windows [Version 10.0.18936.1000])
  • Description:
    If I connect to the redis server on Windows 10 from node redis on WSL using the IP (WSL Interface) of the host, everything works fine.
    Also, it works if I connect from WSL 1 to the server using the domain(.local is not needed here) or when I connect to the redis server running on WSL2(without .local/see Note).
    But, if I connect to the redis server using the hostname(<hostname of the (real) machine>.local), I get the following error:
Error: Redis connection to <hostname of the (real) machine>.local:6379 failed - getaddrinfo ENOTFOUND <hostname of the (real) machine>.l
ocal <hostname of the (real) machine>.local:6379
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
Emitted 'error' event at:
    at RedisClient.on_error (/home/dan/daydream/node_modules/redis/index.js:406:14)
    at Socket.<anonymous> (/home/dan/daydream/node_modules/redis/index.js:279:14)
    at Socket.emit (events.js:189:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

[Notes]:
If you do not include the .local in WSL2, the hostname will resolve to the WSL2 VM and not the host.
I can also connect to the redis server and enter commands using the Command telnet <hostname of the (real) machine>.local 6379.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions