Brief Introduction
I bought a domain name example.ir
from my country domain name provider nic.ir
and
a VPS from examplevps.ir
.
My VPS gave me an static IP and let's imagine it's: 170.120.100.140
Installed a web server running on localhost 127.0.0.1
and eth0 170.120.100.140
.
I can connect to my VPS through ssh and do whatever I want and I'm a newbie... my first VPS.
What have I done?
Actually setup my bind9 like this:
named.conf.local
zone "example.ir" {
type master;
file "/etc/bind/db.example.ir";
};
zone "140.100.120.170.in-addr.arpa" {
type master;
file "/etc/bind/db.170";
};
db.example.ir
$TTL 604800
@ IN SOA example.ir. root.example.ir. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS example.ir.
@ IN A 170.120.100.140
@ IN AAAA ::1
db.170
$TTL 604800
@ IN SOA example.ir. root.example.ir. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS example.ir.
170 IN PTR example.ir.
and also never forget to:
service bind9 restart
What Do I Expect?
root@examplevps$ nslookup example.ir
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: example.ir
Address: 170.120.100.140
This is what I get
root@examplevps$ nslookup example.ir
;; Got SERVFAIL reply from 8.8.8.8, trying next server
Server: 4.2.2.4
Address: 4.2.2.4#53
** server can't find example.ir: SERVFAIL
Conclusion
Based on information I provided above it's completely clear what I want... and I think I must do something like:
+------------------+
| My VPS |
| 170.120.100.140 |
+------------------+
|
+------------------+
| ns.examplevps.ir | bind 170.120.100.140 > example.ir
+------------------+
|
+------------------+
| nic.ir | bind ns.examplevps.ir > nic.ir
+------------------+
I read many pages online but still can't figure out how it works.