LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-03-2015, 07:23 AM   #1
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Rep: Reputation: Disabled
bind DNS issues resolving MX


Hi everyone.

I am quiye new to DNS (bind) and i started recently to setup my own domain and dns servers in order to gain some experience and see how things working from practical view.

So i got my domain, lets say "mysite.net" and rented two (2) cheap vps which act as nameservers (ns1 and ns2). One primary and one secondary. Actually the one server also act as a mail server with postfix.

My problem is that when i "dig" for mx records i dont get any answear. I only get answear if i query my dns server but when i query lets say google`s servers still dont get any respond.

Here is my bind config:


Code:
; A_RECORDS
ns1        IN A 111.111.111.111
ns2        IN A 222.222.222.222
server     IN A 111.111.111.111
junior     IN A 222.222.222.222
mail       IN A 111.111.111.111

; CNAME
vpn        IN CNAME server
gitlab     IN CNAME server
www        IN CNAME server

; MX_RECORDS
mysite.net.  IN MX 10 mail.mysite.net.
and some tests:

Code:
dude@station:~$ping -c 5 server.mysite.net
PING server.mysite.net (111.111.111.111) 56(84) bytes of data.
64 bytes from 111.111.111.111: icmp_seq=1 ttl=47 time=150 ms
64 bytes from 111.111.111.111: icmp_seq=2 ttl=47 time=150 ms
64 bytes from 111.111.111.111: icmp_seq=3 ttl=47 time=150 ms
64 bytes from 111.111.111.111: icmp_seq=4 ttl=47 time=150 ms
64 bytes from 111.111.111.111: icmp_seq=5 ttl=47 time=150 ms

--- server.mysite.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 150.188/150.359/150.862/0.553 ms



dude@station:~$ping -c 5 mail.mysite.net
PING mail.mysite.net (111.111.111.111) 56(84) bytes of data.
64 bytes from 111.111.111.111: icmp_seq=1 ttl=47 time=149 ms
64 bytes from 111.111.111.111: icmp_seq=2 ttl=47 time=155 ms
64 bytes from 111.111.111.111: icmp_seq=3 ttl=47 time=148 ms
64 bytes from 111.111.111.111: icmp_seq=4 ttl=47 time=150 ms
64 bytes from 111.111.111.111: icmp_seq=5 ttl=47 time=149 ms

--- mail.mysite.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 148.999/150.842/155.766/2.584 ms



dude@station:~$dig mx @8.8.8.8 mail.mysite.net.

; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> mx @8.8.8.8 mail.mysite.net.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7307
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;mail.mysite.net.		IN	MX

;; AUTHORITY SECTION:
mysite.net.		1799	IN	SOA	ns1.mysite.net. admin.mysite.net. 9 604800 86400 2419200 604800

;; Query time: 212 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Mar 03 15:04:52 EET 2015
;; MSG SIZE  rcvd: 93




dude@station:~$dig mx @ns1.mysite.net mail.mysite.net.

; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> mx @ns1.mysite.net mail.mysite.net.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15097
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mail.mysite.net.		IN	MX

;; AUTHORITY SECTION:
mysite.net.		14400	IN	SOA	ns1.mysite.net. admin.mysite.net. 9 604800 86400 2419200 604800

;; Query time: 152 msec
;; SERVER: 107.150.8.230#53(107.150.8.230)
;; WHEN: Tue Mar 03 15:04:56 EET 2015
;; MSG SIZE  rcvd: 93
As it seems it cant resolve the mx record.


Any advices?
 
Old 03-03-2015, 09:16 AM   #2
linuxtech99
Member
 
Registered: Jan 2015
Posts: 35

Rep: Reputation: 4
OK. You setup MX record of mysite.net to mail.mysite.net. So you need to lookup the MX record of mysite.net, not mail.mysite.net.


Code:
dig MX mysite.net
dig MX mysite.net @8.8.8.8
 
Old 03-04-2015, 02:19 AM   #3
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linuxtech99 View Post
OK. You setup MX record of mysite.net to mail.mysite.net. So you need to lookup the MX record of mysite.net, not mail.mysite.net.


Code:
dig MX mysite.net
dig MX mysite.net @8.8.8.8
Hi, thanks for your comment. Indeed you are right trying to resolve the server for a hostname rather than the zone however that was an error during the many steps.

I tried to tig with correct zone name and still had no luck. What it did work tho was when i raised the version number in bind configuratom file and now seems to work fine.

I dont know if that was the case but i think when i added the mx record i didnt increase the version number which might have caused this behavour.

Nevertheless things work properly now.

Thnaks for your time
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] DNS issues BIND 9.7.3 whositwhatnow Linux - Newbie 11 03-13-2012 02:16 PM
BIND (local DNS), network unreachable resolving, IPv4 davidlt Debian 2 02-17-2011 02:42 PM
BIND 9.5 on Fedora Core 9 not resolving dns queries debloxie Linux - Server 2 04-21-2010 04:39 PM
DNS not resolving using bind draxan Linux - Networking 2 08-12-2009 09:59 AM
DNS issues with BIND xemous Linux - Networking 6 01-12-2005 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration