I am designing a private LAN in Linux,

I have a dns server locally which had an ip address ,

I had installed BIND in this server and configured both FORWARD AND REVERSE look-up in /var/named.conf for a domain name example.com something as follows.

zone "example.com" {
type master;
file "/var/named/example.com.zone";
allow-update { none; };

zone "" {
type master;
file "/var/named/example.com.zone.rr";
allow-update { none; };

Additionally I had created following two files and added the NS, CNAME, MX, A, SOA records appropriately.


MY Issue is - I had added the above dns-server as dns1 in another machine, But I cannot ping to example.com from , what is the issue for that, or I missed some thing to do ?


go to /etc/bind/db

  1. create a forward zone with your name "db.ramkee.local" . you can choose any name instead of ramkee. am just taking it as an example.

vi db.ramkee.local

enter image description here

2 . Then create reverse zone rev.22.168.192.in-addr.arpa

vim rev.22.168.192.in-addr.arpa

enter image description here

3 .Then create a master zone

vim named.conf.local

enter image description here

4 .reload and restart the bind9 service

/etc/init.d/bind9 reload

/etc/init.d/bind9 restart

it must dont show any errors. if you got any errors you must have look at your 3 files( especially pullstops(.), comma(,) )

5 . set resolv.conf as DNS server IP

vim /etc/resolv.conf


6 .then try to nslookup with yourself (IP and FQDN)


nslookup server.ramkee.local

then it will show you the details of that FQDN and IP

Still if you got any errors please revert here

this setup will work on ubuntu 12.04. and i have mention only for 192.168.22.X range. if you want another range let me know

  • Thanks, but i cannot ping to hostname from other machine – Tom Aug 9 '14 at 15:25
  • 1
    ok.. check your firewall status by using this command "service ufw cstatus" and try to ping google.com from your machine. can you provide the details of your /etc/network/interface. – Ramkee Aug 11 '14 at 10:18
  • see that your ip public or hostonly – Ramkee Aug 11 '14 at 14:32
  • Thanks..ip is NOT public, here is the information in /etc/networks - defaults, loopback, link.local, Firwall status NAT, Filter and Mangle tables are empty, no blocking for both systems, /etc/resolv.conf contains server which configured bind) – Tom Aug 11 '14 at 15:49

You set the DNS to example.name and you search example.com. A bit different, huh?

You can find explanation about named.conf here

  • While the link might provide an answer it can quickly become outdated. Please include the main points in your answer and use the link as reference. Thanks. – Matthew Williams Aug 7 '14 at 7:44
  • Main point is the first sentence. And the link is only a reference. Without configuration file /var/named/example.com.zone nothing more can be done. – LHristov Aug 7 '14 at 7:47
  • Thanks for your response @LHristov, But unfortunately there is nothing valuable from your link, for my question, so I think, it would be nice if you erase that answer.. – Tom Aug 9 '14 at 5:51

Reverse-mapping zones can be a bit tricky. You really need to match up with the address space you are using, in this case, RFC1918 private address space This means you should use 168.192.in-addr.arpa for your reverse-mappng zone.


zone "168.192.in-addr.arpa" {
   type master;
   file "/var/named/example.com.zone.rr";
   allow-update { none; };

And in your file for this one, you'll have entries like:

20.0       IN PTR  dns-server.example.com.
25.0       IN PTR  dns2-server.example.com.

Note the trailing period on the names and the backwards octets for the IP addresses.

Hope that helps.

  • Thanks, I think we cannot add two decimal points in PTR, only only last decimal point is allowed.. But my final issue is not yet solved, I need to ping example.com from the system, its dns1 is (in this system we configured the bind, all ns, mx, cname are working correctly in this server)..any idea of this issue? – Tom Aug 9 '14 at 7:42
  • If you try it exactly how I have it, it will work. The "dots" (.) are just domain separators and you have to have a "." at the end of a name to fully-qualify it in these files. Anything without a trailing-dot will be processed as a relative name, and in this case, has ".168.192.in-addr.arpa." appended to it. So "20.0" will become "" which is what you need. – milli Aug 12 '14 at 17:10
  • If you cannot ping "example.com", then you have not created an A record for the empty (or @) domain in your example.com.zone file. Make sure you have @ IN A (with the right IP address of course) – milli Aug 12 '14 at 17:12
  • Thanks That seems something informative, but I am not able to ping it, all records are working correctly in the dns server itself , dig and nslookup seems NOERROR – Tom Aug 14 '14 at 16:10
  • Then you have a connectivity problem if DNS is resolving. – milli Aug 19 '14 at 13:45

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.