where can i change my external DNS entry from local ip to external ip

August 24, 2018 1.1k views
DNS Ubuntu 16.04

dear all

Good morning

my web site can access on my local network by the domain name perfect as (www.p4bmarket.sd or p4bmarket.sd or by ip address 192.168.0.54)
but from out my local network ie globally cannot access it can access by the global ip (196.223.156.148) and work perfect

i am using linux ubuntu 16.04 server on vmware server and the domain name configre by BIND9

the result for the dig command is

root@ns1:/# dig p4bmarket.sd

; <<>> DiG 9.10.3-P4-Ubuntu <<>> p4bmarket.sd
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57556
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;p4bmarket.sd. IN A

;; ANSWER SECTION:
p4bmarket.sd. 604800 IN A 192.168.0.54

;; AUTHORITY SECTION:
p4bmarket.sd. 604800 IN NS ns1.p4bmarket.sd.

;; ADDITIONAL SECTION:
ns1.p4bmarket.sd. 604800 IN A 192.168.0.54

;; Query time: 0 msec
;; SERVER: 192.168.0.54#53(192.168.0.54)
;; WHEN: Wed Aug 22 08:32:18 CAT 2018

;; MSG SIZE rcvd: 91

the result for the host command is
root@ns1:/# host p4bmarket.sd

p4bmarket.sd has address 192.168.0.54

the result for the nslookup command is
root@ns1:/# nslookup www.p4bmarket.sd
Server: 192.168.0.54
Address: 192.168.0.54#53

www.p4bmarket.sd canonical name = ns1.p4bmarket.sd.
Name: ns1.p4bmarket.sd

Address: 192.168.0.54

why i cannit access my wesite globally

Thanks

1 comment
  • Because you need to point your domain @ the external ip(196.223.156.148).

3 Answers

Hi there,

Inside of the domain management console of your domain provider, you can create records towards your server. You should create an A record that forwards your domain to 196.223.156.148

If this is a local server somewhere in your basement at home, you also need to create a NAT entry inside of the NAT table in your router, that would forward port 80 from the outside to your webserver port on the inside running on 192.168.0.54 . This is usually called port-forwarding.

port forwarding is working proper
————————————————————–look at the setup info

Identify Open Ports on Your Internet Connection
your external address
196.223.156.146

open port finder
Remote Address

196.223.156.148

Use Current IP
Port Number
80

Open Port 80 is open on 196.223.156.148.

about

what do you by the
domain management console of your domain provider,

is tools come by bind9 or get info from ubuntu os

  • Allright, then make an A record to redirect the main domain and www to your ip:

    @ IN A 196.223.156.148
    www IN A 196.223.156.148

    • still not working

      bellow is file after change

      ;
      ; BIND data file for local loopback interface
      ;
      $TTL 604800
      @ IN SOA ns1.p4bmarket.sd. admin.p4bmarket.sd. (
      5 ; Serial
      604800 ; Refresh
      86400 ; Retry
      2419200 ; Expire
      604800 ) ; Negative Cache TTL
      ;

      ; Name servers
      p4bmarket.sd. IN NS ns1.p4bmarket.sd.
      p4bmarket.sd. IN NS ns2.p4bmarket.sd.

      ; A records for name servers
      ns1 IN A 192.168.0.54
      ns2 IN A 192.168.0.53

      ; Other A records
      @ IN A 192.168.0.54
      www IN A 192.168.0.53
      ;
      @ IN A 196.223.156.148

      www IN A 196.223.156.148

      please try to connect the system by the 196.223.156.148

      that means NAT is working through the router

    • still not solved i add the comment again

      Dear allstill my problem is not solvedi configure the dns server for my domain ( www.p4bmarket.sd)last trying i used the commandnslookup p4bmarket.sd (or) www.p4bmarket.sdon the server console i got the the bellow line** server can’t find 54.0.168.192.in-addr.arpa: NXDOMAIN named.conf———————–include “/etc/bind/named.conf.options”;include “/etc/bind/named.conf.local”;include “/etc/bind/named.conf.default-zones”;named.conf.options————————————options {  directory “/var/cache/bind”;          recursion no;        allow-transfer { none; };  forwarders {    8.8.8.8;    8.8.4.4;  };  dnssec-validation auto;  auth-nxdomain no;   # conform to RFC1035  listen-on-v6 { any; };};named.conf.local————————-zone “p4bmarket.sd” {        type master;        file “/etc/bind/zones/db.p4bmarket.sd”;  allow-transfer { 192.168.0.53; }; };zone “0.168.192.in-addr.arpa” {        type master;        file “/etc/bind/zones/db.192.168.0”;  allow-transfer { 192.168.0.53; }; };named.conf.default-zones——————————————-zone “.” {  type hint;  file “/etc/bind/db.root”;};zone “localhost” {  type master;  file “/etc/bind/db.local”;};zone “192.in-addr.arpa” {  type master;  file “/etc/bind/zones/db.192.168.0”;};zone “0.in-addr.arpa” {  type master;3  file “/etc/bind/db.0”;};zone “255.in-addr.arpa” {  type master;  file “/etc/bind/db.255”;};i have path like/etc/bind/zones  incloude tow file like bellowdb.192.168.0db.p4bmarket.sd—————————————————-the content like bellow
      db.192.168.0 ———————–;$TTL 604800@ IN SOA ns1.p4bmarket.sd. admin.p4bmarket.sd. (          5   ; Serial      604800   ; Refresh      86400   ; Retry      2419200   ; Expire      604800 ) ; Negative Cache TTL@       IN     NS     ns1.p4bmarket.sd.@       IN     NS     ns2.p4bmarket.sd.@   IN   PTR   p4bmarket.sd.ns1   IN   A   192.168.0.54ns2   IN   A   192.168.0.53201     IN     PTR     ns1.p4bmarket.sd.202     IN     PTR     ns2.p4bmarket.sd.@       IN     A       196.223.156.148www     IN     A       196.223.156.148
      db.p4bmarket.sd

      ————————————–$TTL 604800@ IN SOA ns1.p4bmarket.sd. admin.p4bmarket.sd. (          5   ; Serial      604800   ; Refresh      86400   ; Retry      2419200   ; Expire      604800 ) ; Negative Cache TTL@   IN     NS     ns1.p4bmarket.sd.@   IN     NS     ns2.p4bmarket.sd.@     IN A         192.168.0.54@     IN A         192.168.0.53ns1   IN A         192.168.0.54ns2   IN A         192.168.0.53@   IN A     196.223.156.148www   IN A     196.223.156.148—————————————————————–please help me this problem take long time from me

      • Hi there, you need to give some more information in a better organised way. If you are giving us code / logs, please use the CODE button in the text editor.

        What are you trying to do here? Does this domain only need to be running locally? Because I checked the domain ( p4bmarket.sd ), and it is not registered. You need to first buy the domain, then give the registrar (where you bought the domain) your own nameservers to use, then setup the DNS records inside of the NS.

Have another answer? Share your knowledge.