0

I have A record that has both external IP address (1.2.3.4), and internal (192.168.10.20) one.

When a client wants to connect to this service from the network 192.168.10/24 - it should use 192.168.10.20 one as a target.

If the client is in a different network - then 1.2.3.4 should be used.

I know that for IPv6 there is the address priority resolution, but can I achieve something similar for IPv4?

1 Answer 1

3

This typical approach is to have two A records. One A record points to the internal address, and is provided when a DNS query is made from 192.168.10/24 while the other A record is provided when a DNS query is made from anywhere else. This is typically implemented as a feature of a DNS server, called "Split horizon" (e.g. Wikipedia's article on Split-horizon DNS) lists some other names like "Split DNS". Others may exist, like "Multiview DNS".

Precise details on how to implement this (and probably what the DNS server's name for this feature may be) will vary based on which DNS server software is used.

4
  • zytrax.com/books/dns/ch6/index.html#split-view like this one?
    – jdevelop
    Aug 14, 2017 at 1:46
  • Sure. For BIND-specifically, I believe different versions of BIND may do some things different. So don't just blindly apply any BIND guide without verifying what version of BIND you're using. (Or, do just try it, if you like. That may or may not end up being the fastest route. But, make sure you've backed up your files and can easily revert if you make changes that make things worse.)
    – TOOGAM
    Aug 14, 2017 at 1:49
  • Yeah, will try that. I guess I will have some fun time, since the primary zone is configured on Amazon, and they only provide split-horizon for their VPC. Perhaps it will be easier for me to setup BIND on the router and configure zone on it. Any chance you know if I can have BIND to use local A records that were provided in the config, and if none - delegate the request to the "external" server, so it will merge local and remote zones with "local overrides remote" ?
    – jdevelop
    Aug 14, 2017 at 1:53
  • Yup, commonplace. What you're asking about is to create a local caching DNS server (which can be used in addition to a publicly used server).
    – TOOGAM
    Aug 14, 2017 at 2:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .