for a test setup of a software application (with apps, specific hardware and so on) i need to route an public existing domain to an internal server instead of the public server. I would do this with a network, special configured for this test setup. The server with the software, apps and special hardware are in this network. I would rout the requests to the concerning domain to the internal server with a simple DNS server

This DNS server needs to: route all requests to the domain *.internal.net to resolve all other domain names via an external DNS server, e.g.

I have some experience with CentOS (our software in running on a CentOS server) so i decided to setup the DNS server on Centos 7. After some Googling i found that i can set up the DNS server under CentOS with named.

After installing named, i changed the /etc/named.conf file as described in one of the tutorials i found via Google. I added at the bottom:

zone "." IN {
    type master;
    file "internal.net";
    allow-update { none; };

Te rest of the file is not changed. I also created a file internal.net in /var/named with the following content:

$TTL 3200
@       IN      SOA     parkzz.net    (
    2016050204      ; serial
    3600            ; refresh
    900             ; retry
    604800          ; expire
    86400           ; nxdomain ttl

@                 IN      NS      internal.net
internal.net      IN      A
www.internal.net  IN      A
*.internal.net    IN      A

After executing 'service named restart' and configuring the ip of the DNS server into my windows, i noticed that the domain internal.net was not routed to my "internal" web server.

I also found on the internet that the part (what is inside the /etc/named.conf by default)

 zone "." IN {
    type hint;
    file "named.ca";

is used to resolve "unknown" domains over an external DNS server. But i can also not visit other websites like google.nl after i set my DNS IP to the IP of my own DNS server.

What i'm doing wrong? i mean i really need some small basics but can not get it working at all.

  • Can't you just configure entries in your hosts files on the affected machines? Setting up a complete DNS server seems like overkill for this. – Sven Dec 4 '17 at 13:47
  • unfortunately not, i need to connect 2 smartphones (iOS and Android) and some custom hardware to the same network as they make requests to x.internal.net The host file does also not support a wildcard (*.internal.net) what is used by our software. For an external audit we need to simulate the real environment 1 to 1 in a test setting. This means we cannot change the API URL's in the software else i would have done that. Thanks for your idea anyway! – CodeNinja Dec 4 '17 at 13:51

Make sure that the named.ca file is populated and up to date. Get a current one by FTP using

wget --user=ftp --password=ftp ftp://ftp.rs.internic.net/domain/db.cache -O /etc/named/named.ca

BIND's logging is usually good by default although you don't mention what OS you are using but it does normally show any configuration errors. A common issue is that it's configured to listen on localhost, which I think is the default so you may need it to listen on an interface.

You can test from your desktop with nslookup in a cmd window with nslookup -v internal.net which should show if your server is responding at all.

You could also use a forwarding DNS server instead so you would need to configure forwarders in your BIND configuration. This guide may help.

| improve this answer | |
  • You do not need forwarder AND hints – Jacob Evans Dec 4 '17 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.