[PR #95] [CLOSED] Added possibility for automatic resolve dns hostnames to IPs #471

Closed
opened 2026-03-02 08:35:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hwdsl2/docker-ipsec-vpn-server/pull/95
Author: @MekDrop
Created: 10/13/2018
Status: Closed

Base: masterHead: patch-1


📝 Commits (1)

  • ac62a48 Added possibility for automatic resolve dns hostnames to IPs

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 run.sh (+6 -0)

📄 Description

If you are using custom DNS server like Dnsmasq in same docker network it possible now to define DNS server by hostname. Hostname in that case will be resolved to IP and connected user to VPN will get chance to use this DNS server.

Here is example how to use it with docker swarm:

version: '3.6'

services:
  runner:
    image: elifa/swarm-proxy #this image is used to start hwdsl2/ipsec-vpn-server in privileged mode on swarm
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: 4500:4500
    environment:
      RUN: -e="VPN_DNS_SRV1=dns" -e="VPN_DNS_SRV2=1.1.1.1" -e "VPN_PASSWORD=${VPN_PASSWORD}" -e "VPN_USER=${VPN_USER}" -e "VPN_IPSEC_PSK=${VPN_IPSEC_PSK}" -p 500:500/udp -p 4500:4500/udp --privileged -v /lib/modules:/lib/modules:ro --name=vpn-server --network=vpn hwdsl2/ipsec-vpn-server
    networks:
      - access
    deploy:
      mode: replicated
      replicas: 1
      endpoint_mode: vip
      placement:
        constraints: [node.role == manager]
      restart_policy:
        condition: on-failure
        delay: 0s
      update_config:
        parallelism: 1
        delay: 30s

  dns:
    image: jiadx/docker-dns-gen
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      access:
    deploy:
      mode: replicated
      replicas: 1
      endpoint_mode: vip
      placement:
        constraints: [node.role == manager]
      restart_policy:
        condition: any
        window: 5s
        delay: 0s
      update_config:
        parallelism: 1
        delay: 0s
        failure_action: rollback
        order: stop-first

networks:
  access:
    driver: overlay
    attachable: true
    name: vpn
    ipam:
      driver: default
      config:
        - subnet: 10.0.4.0/24

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hwdsl2/docker-ipsec-vpn-server/pull/95 **Author:** [@MekDrop](https://github.com/MekDrop) **Created:** 10/13/2018 **Status:** ❌ Closed **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`ac62a48`](https://github.com/hwdsl2/docker-ipsec-vpn-server/commit/ac62a48757a9287d39f22a5d69685cd2241a2437) Added possibility for automatic resolve dns hostnames to IPs ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `run.sh` (+6 -0) </details> ### 📄 Description If you are using custom DNS server like Dnsmasq in same docker network it possible now to define DNS server by hostname. Hostname in that case will be resolved to IP and connected user to VPN will get chance to use this DNS server. Here is example how to use it with docker swarm: ```yaml version: '3.6' services: runner: image: elifa/swarm-proxy #this image is used to start hwdsl2/ipsec-vpn-server in privileged mode on swarm volumes: - /var/run/docker.sock:/var/run/docker.sock command: 4500:4500 environment: RUN: -e="VPN_DNS_SRV1=dns" -e="VPN_DNS_SRV2=1.1.1.1" -e "VPN_PASSWORD=${VPN_PASSWORD}" -e "VPN_USER=${VPN_USER}" -e "VPN_IPSEC_PSK=${VPN_IPSEC_PSK}" -p 500:500/udp -p 4500:4500/udp --privileged -v /lib/modules:/lib/modules:ro --name=vpn-server --network=vpn hwdsl2/ipsec-vpn-server networks: - access deploy: mode: replicated replicas: 1 endpoint_mode: vip placement: constraints: [node.role == manager] restart_policy: condition: on-failure delay: 0s update_config: parallelism: 1 delay: 30s dns: image: jiadx/docker-dns-gen volumes: - /var/run/docker.sock:/var/run/docker.sock networks: access: deploy: mode: replicated replicas: 1 endpoint_mode: vip placement: constraints: [node.role == manager] restart_policy: condition: any window: 5s delay: 0s update_config: parallelism: 1 delay: 0s failure_action: rollback order: stop-first networks: access: driver: overlay attachable: true name: vpn ipam: driver: default config: - subnet: 10.0.4.0/24 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 08:35:37 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#471
No description provided.