ubuntu server fqdn refusing to connect to website only when connected to openvpn

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












Running on my Ubuntu Server I have
Openvpn Server + Pihole Dns (routing only dns)
& an iredmail server



I have a domain name which I have pointed to the server, and a fqdn is set



Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.



eg.
Connecting to openvpn server using domain in openvpn client config works ✔



connecting to ssh works using domain ✔



connecting to online mail inbox using domain works ✔



when connected to vpn,



all work when connecting via server's public ip address ✔



but refuse connection when using domain.



Im assuming its an firewall/iptables issue but im headdesking rn.



here are my iptables rules (ive combined rules of iredmail and pihole)



*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]

# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Loop device.
-A INPUT -i lo -j ACCEPT

# Allow PING from remote hosts.
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT

# ssh
-A INPUT -p tcp --dport 27 -j ACCEPT

# http, https
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# smtp, submission
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 587 -j ACCEPT

# pop3, pop3s
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT
#-A INPUT -p tcp --dport 10110 -j ACCEPT

# imap, imaps
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
#-A INPUT -p tcp --dport 10143 -j ACCEPT

# lmtp
#-A INPUT -p tcp --dport 24 -j ACCEPT
#-A INPUT -p tcp --dport 1024 -j ACCEPT

# managesieve
#-A INPUT -p tcp --dport 4190 -j ACCEPT
#-A INPUT -p tcp --dport 10419 -j ACCEPT

# Dovecot SASL AUTH service for HAProxy
#-A INPUT -p tcp --dport 12346 -j ACCEPT

# ldap/ldaps
#-A INPUT -p tcp --dport 389 -j ACCEPT
#-A INPUT -p tcp --dport 636 -j ACCEPT


#-A INPUT -p tcp --dport 3306 -j ACCEPT
#-A INPUT -p tcp --dport 4444 -j ACCEPT
#-A INPUT -p tcp --dport 4567 -j ACCEPT
#-A INPUT -p tcp --dport 4568 -j ACCEPT

# PostgreSQL service.
#-A INPUT -p tcp --dport 5432 -j ACCEPT

# Amavisd
#-A INPUT -p tcp --dport 10024 -j ACCEPT
#-A INPUT -p tcp --dport 10025 -j ACCEPT
#-A INPUT -p tcp --dport 10026 -j ACCEPT
#-A INPUT -p tcp --dport 9998 -j ACCEPT

# iRedAPD
#-A INPUT -p tcp --dport 7777 -j ACCEPT

# ftp.
#-A INPUT -p tcp --dport 20 -j ACCEPT
#-A INPUT -p tcp --dport 21 -j ACCEPT

# ejabberd
#-A INPUT -p tcp --dport 5222 -j ACCEPT
#-A INPUT -p tcp --dport 5223 -j ACCEPT
#-A INPUT -p tcp --dport 5280 -j ACCEPT

-I INPUT -i tun0 -j ACCEPT

-A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
-A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT

-A INPUT -p tcp --destination-port 27 -j ACCEPT
-A INPUT -p tcp --destination-port 1194 -j ACCEPT
-A INPUT -p udp --destination-port 1194 -j ACCEPT

-I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

-I INPUT -i lo -j ACCEPT

#-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
#-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
#-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
COMMIT


and the result of ip routes



default via 192.168.1.1 dev enp2s1 proto static
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200






share|improve this question
























    up vote
    0
    down vote

    favorite












    Running on my Ubuntu Server I have
    Openvpn Server + Pihole Dns (routing only dns)
    & an iredmail server



    I have a domain name which I have pointed to the server, and a fqdn is set



    Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.



    eg.
    Connecting to openvpn server using domain in openvpn client config works ✔



    connecting to ssh works using domain ✔



    connecting to online mail inbox using domain works ✔



    when connected to vpn,



    all work when connecting via server's public ip address ✔



    but refuse connection when using domain.



    Im assuming its an firewall/iptables issue but im headdesking rn.



    here are my iptables rules (ive combined rules of iredmail and pihole)



    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT ACCEPT [0:0]

    # Keep state.
    -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

    # Loop device.
    -A INPUT -i lo -j ACCEPT

    # Allow PING from remote hosts.
    -A INPUT -p icmp --icmp-type echo-request -j ACCEPT

    # ssh
    -A INPUT -p tcp --dport 27 -j ACCEPT

    # http, https
    -A INPUT -p tcp --dport 80 -j ACCEPT
    -A INPUT -p tcp --dport 443 -j ACCEPT

    # smtp, submission
    -A INPUT -p tcp --dport 25 -j ACCEPT
    -A INPUT -p tcp --dport 587 -j ACCEPT

    # pop3, pop3s
    -A INPUT -p tcp --dport 110 -j ACCEPT
    -A INPUT -p tcp --dport 995 -j ACCEPT
    #-A INPUT -p tcp --dport 10110 -j ACCEPT

    # imap, imaps
    -A INPUT -p tcp --dport 143 -j ACCEPT
    -A INPUT -p tcp --dport 993 -j ACCEPT
    #-A INPUT -p tcp --dport 10143 -j ACCEPT

    # lmtp
    #-A INPUT -p tcp --dport 24 -j ACCEPT
    #-A INPUT -p tcp --dport 1024 -j ACCEPT

    # managesieve
    #-A INPUT -p tcp --dport 4190 -j ACCEPT
    #-A INPUT -p tcp --dport 10419 -j ACCEPT

    # Dovecot SASL AUTH service for HAProxy
    #-A INPUT -p tcp --dport 12346 -j ACCEPT

    # ldap/ldaps
    #-A INPUT -p tcp --dport 389 -j ACCEPT
    #-A INPUT -p tcp --dport 636 -j ACCEPT


    #-A INPUT -p tcp --dport 3306 -j ACCEPT
    #-A INPUT -p tcp --dport 4444 -j ACCEPT
    #-A INPUT -p tcp --dport 4567 -j ACCEPT
    #-A INPUT -p tcp --dport 4568 -j ACCEPT

    # PostgreSQL service.
    #-A INPUT -p tcp --dport 5432 -j ACCEPT

    # Amavisd
    #-A INPUT -p tcp --dport 10024 -j ACCEPT
    #-A INPUT -p tcp --dport 10025 -j ACCEPT
    #-A INPUT -p tcp --dport 10026 -j ACCEPT
    #-A INPUT -p tcp --dport 9998 -j ACCEPT

    # iRedAPD
    #-A INPUT -p tcp --dport 7777 -j ACCEPT

    # ftp.
    #-A INPUT -p tcp --dport 20 -j ACCEPT
    #-A INPUT -p tcp --dport 21 -j ACCEPT

    # ejabberd
    #-A INPUT -p tcp --dport 5222 -j ACCEPT
    #-A INPUT -p tcp --dport 5223 -j ACCEPT
    #-A INPUT -p tcp --dport 5280 -j ACCEPT

    -I INPUT -i tun0 -j ACCEPT

    -A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
    -A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
    -A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT

    -A INPUT -p tcp --destination-port 27 -j ACCEPT
    -A INPUT -p tcp --destination-port 1194 -j ACCEPT
    -A INPUT -p udp --destination-port 1194 -j ACCEPT

    -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

    -I INPUT -i lo -j ACCEPT

    #-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
    #-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
    #-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
    COMMIT


    and the result of ip routes



    default via 192.168.1.1 dev enp2s1 proto static
    10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
    192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200






    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Running on my Ubuntu Server I have
      Openvpn Server + Pihole Dns (routing only dns)
      & an iredmail server



      I have a domain name which I have pointed to the server, and a fqdn is set



      Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.



      eg.
      Connecting to openvpn server using domain in openvpn client config works ✔



      connecting to ssh works using domain ✔



      connecting to online mail inbox using domain works ✔



      when connected to vpn,



      all work when connecting via server's public ip address ✔



      but refuse connection when using domain.



      Im assuming its an firewall/iptables issue but im headdesking rn.



      here are my iptables rules (ive combined rules of iredmail and pihole)



      *filter
      :INPUT DROP [0:0]
      :FORWARD DROP [0:0]
      :OUTPUT ACCEPT [0:0]

      # Keep state.
      -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

      # Loop device.
      -A INPUT -i lo -j ACCEPT

      # Allow PING from remote hosts.
      -A INPUT -p icmp --icmp-type echo-request -j ACCEPT

      # ssh
      -A INPUT -p tcp --dport 27 -j ACCEPT

      # http, https
      -A INPUT -p tcp --dport 80 -j ACCEPT
      -A INPUT -p tcp --dport 443 -j ACCEPT

      # smtp, submission
      -A INPUT -p tcp --dport 25 -j ACCEPT
      -A INPUT -p tcp --dport 587 -j ACCEPT

      # pop3, pop3s
      -A INPUT -p tcp --dport 110 -j ACCEPT
      -A INPUT -p tcp --dport 995 -j ACCEPT
      #-A INPUT -p tcp --dport 10110 -j ACCEPT

      # imap, imaps
      -A INPUT -p tcp --dport 143 -j ACCEPT
      -A INPUT -p tcp --dport 993 -j ACCEPT
      #-A INPUT -p tcp --dport 10143 -j ACCEPT

      # lmtp
      #-A INPUT -p tcp --dport 24 -j ACCEPT
      #-A INPUT -p tcp --dport 1024 -j ACCEPT

      # managesieve
      #-A INPUT -p tcp --dport 4190 -j ACCEPT
      #-A INPUT -p tcp --dport 10419 -j ACCEPT

      # Dovecot SASL AUTH service for HAProxy
      #-A INPUT -p tcp --dport 12346 -j ACCEPT

      # ldap/ldaps
      #-A INPUT -p tcp --dport 389 -j ACCEPT
      #-A INPUT -p tcp --dport 636 -j ACCEPT


      #-A INPUT -p tcp --dport 3306 -j ACCEPT
      #-A INPUT -p tcp --dport 4444 -j ACCEPT
      #-A INPUT -p tcp --dport 4567 -j ACCEPT
      #-A INPUT -p tcp --dport 4568 -j ACCEPT

      # PostgreSQL service.
      #-A INPUT -p tcp --dport 5432 -j ACCEPT

      # Amavisd
      #-A INPUT -p tcp --dport 10024 -j ACCEPT
      #-A INPUT -p tcp --dport 10025 -j ACCEPT
      #-A INPUT -p tcp --dport 10026 -j ACCEPT
      #-A INPUT -p tcp --dport 9998 -j ACCEPT

      # iRedAPD
      #-A INPUT -p tcp --dport 7777 -j ACCEPT

      # ftp.
      #-A INPUT -p tcp --dport 20 -j ACCEPT
      #-A INPUT -p tcp --dport 21 -j ACCEPT

      # ejabberd
      #-A INPUT -p tcp --dport 5222 -j ACCEPT
      #-A INPUT -p tcp --dport 5223 -j ACCEPT
      #-A INPUT -p tcp --dport 5280 -j ACCEPT

      -I INPUT -i tun0 -j ACCEPT

      -A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
      -A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
      -A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT

      -A INPUT -p tcp --destination-port 27 -j ACCEPT
      -A INPUT -p tcp --destination-port 1194 -j ACCEPT
      -A INPUT -p udp --destination-port 1194 -j ACCEPT

      -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

      -I INPUT -i lo -j ACCEPT

      #-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
      #-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
      #-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
      COMMIT


      and the result of ip routes



      default via 192.168.1.1 dev enp2s1 proto static
      10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
      192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200






      share|improve this question












      Running on my Ubuntu Server I have
      Openvpn Server + Pihole Dns (routing only dns)
      & an iredmail server



      I have a domain name which I have pointed to the server, and a fqdn is set



      Everything works separately unless I wish to connect to this server via the domain name (for example the web address of the online mailbox) with a client already connected via OpenVPN - Im getting connection refused errors.



      eg.
      Connecting to openvpn server using domain in openvpn client config works ✔



      connecting to ssh works using domain ✔



      connecting to online mail inbox using domain works ✔



      when connected to vpn,



      all work when connecting via server's public ip address ✔



      but refuse connection when using domain.



      Im assuming its an firewall/iptables issue but im headdesking rn.



      here are my iptables rules (ive combined rules of iredmail and pihole)



      *filter
      :INPUT DROP [0:0]
      :FORWARD DROP [0:0]
      :OUTPUT ACCEPT [0:0]

      # Keep state.
      -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

      # Loop device.
      -A INPUT -i lo -j ACCEPT

      # Allow PING from remote hosts.
      -A INPUT -p icmp --icmp-type echo-request -j ACCEPT

      # ssh
      -A INPUT -p tcp --dport 27 -j ACCEPT

      # http, https
      -A INPUT -p tcp --dport 80 -j ACCEPT
      -A INPUT -p tcp --dport 443 -j ACCEPT

      # smtp, submission
      -A INPUT -p tcp --dport 25 -j ACCEPT
      -A INPUT -p tcp --dport 587 -j ACCEPT

      # pop3, pop3s
      -A INPUT -p tcp --dport 110 -j ACCEPT
      -A INPUT -p tcp --dport 995 -j ACCEPT
      #-A INPUT -p tcp --dport 10110 -j ACCEPT

      # imap, imaps
      -A INPUT -p tcp --dport 143 -j ACCEPT
      -A INPUT -p tcp --dport 993 -j ACCEPT
      #-A INPUT -p tcp --dport 10143 -j ACCEPT

      # lmtp
      #-A INPUT -p tcp --dport 24 -j ACCEPT
      #-A INPUT -p tcp --dport 1024 -j ACCEPT

      # managesieve
      #-A INPUT -p tcp --dport 4190 -j ACCEPT
      #-A INPUT -p tcp --dport 10419 -j ACCEPT

      # Dovecot SASL AUTH service for HAProxy
      #-A INPUT -p tcp --dport 12346 -j ACCEPT

      # ldap/ldaps
      #-A INPUT -p tcp --dport 389 -j ACCEPT
      #-A INPUT -p tcp --dport 636 -j ACCEPT


      #-A INPUT -p tcp --dport 3306 -j ACCEPT
      #-A INPUT -p tcp --dport 4444 -j ACCEPT
      #-A INPUT -p tcp --dport 4567 -j ACCEPT
      #-A INPUT -p tcp --dport 4568 -j ACCEPT

      # PostgreSQL service.
      #-A INPUT -p tcp --dport 5432 -j ACCEPT

      # Amavisd
      #-A INPUT -p tcp --dport 10024 -j ACCEPT
      #-A INPUT -p tcp --dport 10025 -j ACCEPT
      #-A INPUT -p tcp --dport 10026 -j ACCEPT
      #-A INPUT -p tcp --dport 9998 -j ACCEPT

      # iRedAPD
      #-A INPUT -p tcp --dport 7777 -j ACCEPT

      # ftp.
      #-A INPUT -p tcp --dport 20 -j ACCEPT
      #-A INPUT -p tcp --dport 21 -j ACCEPT

      # ejabberd
      #-A INPUT -p tcp --dport 5222 -j ACCEPT
      #-A INPUT -p tcp --dport 5223 -j ACCEPT
      #-A INPUT -p tcp --dport 5280 -j ACCEPT

      -I INPUT -i tun0 -j ACCEPT

      -A INPUT -i tun0 -p tcp --destination-port 53 -j ACCEPT
      -A INPUT -i tun0 -p udp --destination-port 53 -j ACCEPT
      -A INPUT -i tun0 -p tcp --destination-port 80 -j ACCEPT

      -A INPUT -p tcp --destination-port 27 -j ACCEPT
      -A INPUT -p tcp --destination-port 1194 -j ACCEPT
      -A INPUT -p udp --destination-port 1194 -j ACCEPT

      -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

      -I INPUT -i lo -j ACCEPT

      #-A INPUT -p udp --dport 80 -j REJECT --reject-with icmp-port-unreachable
      #-A INPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset
      #-A INPUT -p udp --dport 443 -j REJECT --reject-with icmp-port-unreachable
      COMMIT


      and the result of ip routes



      default via 192.168.1.1 dev enp2s1 proto static
      10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
      192.168.1.0/24 dev enp2s1 proto kernel scope link src 192.168.1.200








      share|improve this question











      share|improve this question




      share|improve this question










      asked May 13 at 13:18









      wlvar

      11




      11

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1035700%2fubuntu-server-fqdn-refusing-to-connect-to-website-only-when-connected-to-openvpn%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1035700%2fubuntu-server-fqdn-refusing-to-connect-to-website-only-when-connected-to-openvpn%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491