external resolve dns linux bind9 [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I'm 3 days trying to fix my nameservers to a .tk domain, just for testing because I'm going to not go to .com. I wanted to understand how I could solve my DNS even outside and not just on a private network. Repeat the server configuration:
named.conf.options
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// forwarders {
// 0.0.0.0;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
named.conf.local
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "fresky.tk" IN {
type master;
file "/etc/bind/zones/db.fresky.tk";
};
zone "33.163.31.176.in-addr.arpa" IN {
type master;
file "/etc/bind/zones/db.33.163.31.176.in-addr.arpa";
};
ZONE fresky.tk
;
; BIND data file for local loopback interface
;
$TTL 604800
# IN SOA ns1.fresky.tk. admin.fresky.tk. (
2006020201 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800); Negative Cache TTL
;
;
; NS Records
;
fresky.tk. IN NS ns1.fresky.tk.
fresky.tk. IN NS ns2.fresky.tk.
;
; A Records (Only Nameservers)
;
ns1 IN A 176.31.163.33
ns2 IN A 176.31.163.33
;
; A Records (General)
;
fresky.tk. IN A 176.31.163.33
www.fresky.tk. IN A 176.31.163.33
ftp.fresky.tk. IN A 176.31.163.33
ZONE Reverse 33.163.31.173.in-addr.arpa
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
# IN SOA fresky.tk. admin.fresky.tk. (
2006020201 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800); Negative Cache TTL
;
;
; NS Records
;
IN NS ns1.fresky.tk.
IN NS ns2.fresky.tk.
;
; PTR Records (Only NameSever)
;
33.163.31.176.in-addr.arpa. IN PTR ns1.fresky.tk.
33.163.31.176.in-addr.arpa. IN PTR ns2.fresky.tk.
;
; PTR Records (General)
;
33.163.31.176.in-addr.arpa. IN PTR ftp.fresky.tk.
33.163.31.176.in-addr.arpa. IN PTR www.fresky.tk.
/etc/hosts && /etc/resolv.con
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
176.31.163.33 fresky.tk fresky
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
search fresky.tk
nameserver 127.0.0.1

You need to register glue records at https://my.freenom.com
(My Domains / Manage Domain / Management tools / Register glue records)
Add 176.31.163.33 as IP address for ns1.fresky.tk and ns2.fresky.tk

Related

server: Name or service not known BIND9

root#server: ping -c 4 servidor
ping: servidor: Name or service not known
Could someone please tell me if I have any syntax errors or is it some other kind of error? Thank you very much in advance.
The db.domain.com file should be as follows, You also forgot the NS records
$ORIGIN .
$TTL 604800 ; 1 week
domain.com IN SOA f95. root.domain.com. (
165 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
2419200 ; expire (4 weeks)
604800 ; minimum (1 week)
)
NS ns1.domain.com.
NS ns2.domain.com.
AAAA ::1
MX 10 mail.domain.com.
after any change to this file you should change serial number and then restart bind service.

BIND9 is running but not pinging my domain

There is a cloud server with IP 51.254.79.239
tt1.domain.com and tt2.domain.com are the name servers.
these are the zone options used
zone "domain.com" {
type master;
file "/etc/bind/db.domain.com";
};
zone "79.254.51.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.51";
};
db.domain.com file
$TTL 14400
# IN SOA tt1.domain.com. root.domain.com. (
17
7200
3600
1209600
180 )
# 14400 IN NS tt1.domain.com.
# 14400 IN NS tt2.domain.com.
tt1 14400 IN A 51.254.79.239
tt2 14400 IN A 51.254.79.239
# 14400 IN A 51.254.79.239
mail 14400 IN A 51.254.79.239
www 14400 IN A 51.254.79.239
pop 14400 IN A 51.254.79.239
ftp 14400 IN A 51.254.79.239
# 14400 IN MX 10 mail.domain.com.
# 14400 IN TXT "v=spf1 a mx ip4:51.254.79.239 ?all"
_dmarc 14400 IN TXT "v=DMARC1; p=none"
and the rev
$TTL 604800
# IN SOA tt1.domain.com. root.domain.com. (
16 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
IN NS tt1.domain.com
IN NS tt2.domain.com.
79.254.51 IN PTR tt1.domain.com. ; 51.254.79.239
79.254.51 IN PTR tt2.domain.com. ; 51.254.79.239
and it's Active: active (running) since Mon !
what it could be the problem that there is no ping answer on domain.com?!
Ping, if you use it with a hostname, involves looking up the name, but what you check is connectivity not DNS.
From your example, I can see, that both of your supposed "nameservers" are in fact the same server, as the one they are resolving. So I strongly assume, this "name server" is not authoritative, which means, no other name server in the hierarchy cares for the information it has. Did you think, you can just setup a nameserver and it would be queried for the domain, you told it?
You can easily check for the primary name server, with:
dig +short SOA domain.com
Or for all authoritative name servers with:
dig +short NS domain.com
whois also gives you this information.
Usually your provider gives you some interface to the resource records pertaining to your domain and updates the authoritative name servers accordingly, so you should probably look for this first.
You can then check, if everything with your changes is ok, with many online tools, for example this:
http://viewdns.info/dnsreport/

Bind9 Servfail, unknown host

I'm new to bind9. I've fixed a lot of issues, but now I need some help.
I basically just want to bind my domain magestionfacile.fr and some subdomains to 94.23.108.206.
Here's my configuration files:
named.conf.local
zone "magestionfacile.fr" {
type master;
allow-transfer {94.23.108.206;};
file "/etc/bind/db.magestionfacile.fr";
};
db.magestionfacile.fr
;
; BIND reverse data file for broadcast zone
;
; Time To Live
$TTL 604800
; General Informations
# IN SOA magestionfacile.fr. root.magestionfacile.fr. (
10 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
; Domain TTL IN Type Value
IN NS ns354747.ovh.net.
IN NS sdns1.ovh.net.
IN NS sdns2.ovh.net.
# IN A 94.23.108.206
vmx IN A 94.23.108.206
vimexcom IN CNAME vmx.magestionfacile.fr.
ownercheck IN TXT "some_number"
The three NS directives, I'm not sure if it's the right values. I mean, I'm not even sure if only one DNS server is sufficient so...
Some tests:
odoo#yann-acer-portable:~$ nslookup magestionfacile.fr 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: magestionfacile.fr
Address: 94.23.108.206
odoo#yann-acer-portable:~$ nslookup magestionfacile.fr
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find magestionfacile.fr: SERVFAIL
odoo#yann-acer-portable:~$ ping magestionfacile.fr
ping: unknown host magestionfacile.fr
odoo#yann-acer-portable:~$ ping vmx.magestionfacile.fr
ping: unknown host vmx.magestionfacile.fr
I'm aware that usually, you need two DNS servers, right ? Can I do with one ? Thanks for the help !
SERVFAIL means that the nameserver for one reason or another could not produce a valid answer to the question. For more information, you need to look in the nameserver log file (although if what you posted up there is the entire zone file, the problem likely is a missing $ORIGIN).

how to configure hostname to have identical name as subdomain?

I've accomplished the following easily on a unix system, but I don't manage to get the same configured on a MS Windows server:
subdomain.example.org is a zone, so that I can setup child hostnames like host.subdomain.example.org. Furthermore, subdomain.example.org is also an entry point to the subdomain and runs a webserver. For that purpose I create an A record that points to an IP address. That is, the hostname is identical with the subdomain name.
I don't seem to be able to reproduce this on the windows server. once I create the subdomain, I can't add the A record. What's the secret to getting this up and running?
When creating A records you can use the # symbol for the record name to indicate the parent record i.e. no record name. In your case this applies to subdomain zones (and beyond).
example.com = # IN A 1.2.3.4
www.example.com = www IN A 192.168.0.2
Example raw dns zone file:
$TTL 14400
$ORIGIN example.com.
# 1D IN SOA ns1.example.com. hostmaster.example.com. (
2002022401 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.example.com. ; in the domain
IN NS ns2.smokeyjoe.com. ; external to domain
IN MX 10 mail.another.com. ; external mail provider
# IN A 1.2.3.4 ; root record here would be value for example.com
ns1 IN A 192.168.0.1 ;name server definition
www IN A 192.168.0.2 ;web server definition
ftp IN CNAME www.example.com. ;ftp server definition
bill IN A 192.168.0.3
fred IN A 192.168.0.4

Bind DNS host pointing name servers to different IPs

Okay, at the moment i have my domain's host file which was generated by the Webmin control panel. I have a box to myself with several IPs and i want to make use of more than one. I don't fully understand everything to do with host files but I know enough to get by.
Can anyone suggest how i would go about changing the below host file to make my two name servers and mail server have their own IPs and then my domains and sub domains share another?
$ttl 120
# IN SOA ns1.example.com. webmaster.example.com. (
1283718781
1D
120
7D
120 )
example.com. IN NS ns1.example.com.
example.com. IN A 192.168.0.1
www.example.com. IN A 192.168.0.1
ftp.example.com. IN A 192.168.0.1
m.example.com. IN A 192.168.0.1
localhost.example.com. IN A 127.0.0.1
webmail.example.com. IN A 192.168.0.1
admin.example.com. IN A 192.168.0.1
mail.example.com. IN A 192.168.0.1
example.com. IN MX 5 mail.example.com.
example.com. IN NS ns2.example.com.
[edit]
Just to add, can you also suggest any improvements because at present initial loading of the website is slow, i did a dns test from an online tool and resolving was taking a long while. After the first page load the site's home page then loads in less than 2 seconds, presumably because stuff has been cached after the first load.
please and thanks in advance for any help.
I'm not sure if I understood your question but I would use following zone file for example.com domain:
$ttl 120
# IN SOA ns1.example.com. webmaster.example.com. (
2010091401 ; Serial format YYYYmmddXX where XX is 01-99
1D
120
7D
120 )
IN NS ns1.example.com.
IN NS ns2.example.com.
IN MX 5 mail.example.com.
IN A 192.168.0.1
ns1 IN A 192.168.xxx.xxx ; ns1 ip
ns2 IN A 192.168.xxx.xxx ; ns2 ip
www IN A 192.168.0.1
ftp IN A 192.168.0.1
m IN A 192.168.0.1
webmail IN A 192.168.0.1
admin IN A 192.168.0.1
mail IN A 192.168.0.1
localhost IN A 127.0.0.1

Resources