Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DNS issue with internal and external domain

Currently, I use the Sophos UTM as my DNS server. I host a few websites (web server is internal) which are accessible from the Internet and I have DNAT's so internal users can access the sites as well. I have encountered an issue and I don't know how to resolve.


I have the following host definition (mysite.com is being used as a substitution for the real FQDN): 

  

and the following DNAT: 

...
Rule type: DNAT
Traffic from: ANY
Using service: 80, 443
Going to: External WAN (public IP address of FQDN)
Change destination to: mysite.com host (pictured in the image above)
...
 
With this setup, everything works fine. Local users and external users can access the domains listed in the network definition above.


 The issue I have encountered is that I have another subdomain (info.mysite.com) that I cannot access from the internal network unless I remove the DNS host name "mysite.com" from the network definition that is pictured above. Of course if I do that, internal users can no longer access 'mysite.com'. 

I cannot set a static record for 'info.mysite.com' in Sophos because it is hosted externally and it has a dynamic public IP address.
 
 Why does having "mysite.com" defined in the network definition cause 'info.mysite.com' to be unresolvable for internal users?


When using nslookup on an internal PC, I get the following: Unknown can't find info.mysite.com: Non-existent domain. If I change the PC's DNS server from Sophos to a public one (e.g., 8.8.8.8), 'info.mysite.com' is accessible from that PC. I also flush the resolver cache on both the Sophos unit and the PC every time I make a change.


This thread was automatically locked due to age.
  • Hi jeffshead. Try to flush the dns cache in webadmin... Does that help?


    Sorry,

    Please ignore my post, I realize that you already cleared the cache...
  • Take a look at the DNS (bind) configuration files on the UTM - it is taking over the entire domain when you make particular (domain.tld) definitions:  /var/sec/chroot-bind/zones/static

    Does DNS request routing offer a solution?
  • Another idea, did you try to restart the named service?

    /var/mdw/scripts/named restart
  • @BAlfson
    I don't understand your question :-) Maybe my explanation was not clear. 


    info.mysite.com is an external server with a dynamic public IP address. The main domain (mysite.com) and all other sub domains are internal. I can access info.mysite.com from internal PC's if I do one of the following:

    [LIST=1]
    • Remove mysite.com from the host network definition in Sophos.
    • Add a host network definition in Sophos for info.mysite.com with it's current public IP address.
    • Use the public IP address of info.mysite.com (http://72.2.2.2) instead of the DNS name to avoid a DNS query (which does not happen).
    [/LIST]
    It seems to me that Sophos takes over the entire domain when the base domain is specified in a host definition so DNS queries are not made on subdomains that are not specified anywhere in Sophos.


    @teched
    When I view the files and their contents in  '/var/sec/chroot-bind/zones/static', I don't see anything other than what matches the host definitions. What should I be looking for? I already tried DNS request routing for info.mysite.com. Didn't make any difference.


    @roesch4alc
    The UTM has been rebooted several times so restarting the named service would not matter, would it?

    --------------------------------------------------------------------
    Sophos UTM 9.714-4 - Home User
    Currently testing VM on i3-9100 @ 3.60 GHz
    16 GB RAM
    Dell Optiplex XE
    Intel Core 2 Duo CPU E8600 @ 3.33GHz
    8GB RAM
    --------------------------------------------------------------------

  • I misunderstood - I thought you were accessing an internal server from your LAN going via a DNAT.

    Add a host network definition in Sophos for info.mysite.com with it's current public IP address

    You might try a workaround: put your private IP in public DNS for mysite.com and delete the 'Hostname' in your Host definition.  From the outside, people have to use www.mysite.com.  Any luck with that?

    Or, use www.mysite.com internally and externally.  If folks use mysite.com pointing at your public IP instead of www.mysite.com, add a Full NAT for LAN traffic going to the public IP on the External interface.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Or, use www.mysite.com internally and externally.  If folks use mysite.com pointing at your public IP instead of www.mysite.com, add a Full NAT for LAN traffic going to the public IP on the External interface.

    Cheers - Bob
     

    So I should remove mysite.com from the network definition so it only has www.mysite.com and www2.mysite.com?
     
    I currently have the following DNAT:  
     ...
     Rule type: DNAT
     Traffic from: ANY
     Using service: 80, 443
     Going to: External WAN (public IP address of FQDN)
     Change destination to: mysite.com host (pictured in the image in post #1)
     ... 

    I should add a Full NAT as below? 
       ...
     Rule type: Full NAT
    Traffic from: Internal (network)
     Using service: 80, 443
     Going to: External WAN (public IP address of FQDN)
     Change destination to: host definition (www.mysite.com, www2.mysite.com with IPv4 192.168.1.100)
    Change source to: Internal (address) 192.168.0.1
    ...


    What do I do with my current DNAT?


    -----------------------
     UPDATE:
    -----------------------
    I removed mysite.com from the host definition and I kept the DNAT just as I listed it above. I added the Full NAT (just as I listed that above) above the DNAT.
     
    It seems to be working but this seems like an inefficient, awkward workaround for something that should be quite simple.   

    @BAlfson
    Did I follow your instructions correctly?

    Presumably, this is a bug?

    --------------------------------------------------------------------
    Sophos UTM 9.714-4 - Home User
    Currently testing VM on i3-9100 @ 3.60 GHz
    16 GB RAM
    Dell Optiplex XE
    Intel Core 2 Duo CPU E8600 @ 3.33GHz
    8GB RAM
    --------------------------------------------------------------------

  • Just to eliminate the need for ordering the NAT rules, you might want to change the DNAT to 'Traffic from: Internet'.

    Now that I think about it again, I guess I don't know enough about the inner workings of bind to know if this would be a bug or a feature request.

    There were a lot of fixes in 9.314, so I would recommend moving to that.  I doubt that this issue is addressed any differently though.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • @Bob
    I neglected to update my signature. I'm actually running v9.350-12.


    I'll keep what I have and see it does.


    Thanks, again, for sharing your wisdom. I really appreciate it.

    --------------------------------------------------------------------
    Sophos UTM 9.714-4 - Home User
    Currently testing VM on i3-9100 @ 3.60 GHz
    16 GB RAM
    Dell Optiplex XE
    Intel Core 2 Duo CPU E8600 @ 3.33GHz
    8GB RAM
    --------------------------------------------------------------------

  • Hi,

    I run in this configuration where I have internal hostnames in my domain which point at internal servers using the network host definition, and can access external APIs etc also on my domain that point at Amazon servers which are dynamic.  DNS for the domain is handled at Amazon and the UTM consults the DNS at Amazon for the relevant records, this works as designed.

    In DHCP are you using a DNS search list, do you have any forwarders or DNS request routing defined?

    Thanks.
    Andrew.
  • Hi,

    Here are some commands to try using nslookup

    nslookup:
    info.domain.com
    info.domain.com. (use the dot at the end)
    set type=soa
    domain.com

    Andrew.