LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-26-2015, 11:01 AM   #1
bangnagr
Member
 
Registered: Jan 2013
Posts: 48

Rep: Reputation: 4
BIND - What A record I should add...


Hi All,

I have a website hosted at some web hosting company. Let me call it 'http://www.example.com'.

I have installed bind9 in one of the local server (private IP), called 'ns.example.com'. I have named zone as 'example.com', same as my website.

Following is a forward zone file for 'example.com' in box with hostname 'ns.example.com'
Code:
$ cat db.example.com 

$TTL 86400 ; (1 day)
$ORIGIN example.com.

@ IN SOA ns.example.com. admin.example.com. (
    2015042601 ; serial YYYYMMDDnn
    14400      ; refresh (4 hours)
    1800       ; retry   (30 minutes)
    1209600    ; expire  (2 weeks)
    3600 )     ; minimum (1 hour)

@  IN NS ns.example.com.
ns IN A 192.168.1.7

localhost IN A 127.0.0.1
sql       IN A 192.168.1.100
ftp       IN A 192.168.1.101
Following is a reverse zone file for 'example.com' in box with hostname 'ns.example.com'
Code:
$ cat db.192.168.1 

$TTL 86400 ; (1 day)
$ORIGIN 1.168.192.in-addr.arpa.

@ IN SOA ns.example.com. admin.example.com. (
    2015042601 ; serial YYYYMMDDnn
    14400      ; refresh (4 hours)
    1800       ; retry   (30 minutes)
    1209600    ; expire  (2 weeks)
    3600 )     ; minimum (1 hour)

@ IN NS  ns.example.com.
7 IN PTR ns.example.com.

100 IN PTR sql.example.com.
101 IN PTR ftp.example.com.
resolve.conf
Code:
$ cat /etc/resolv.conf

search example.com
nameserver 192.168.1.7
Everything works perfectly fine. Only problem is, this bind server is unable to resolve http://www.example.com, which is my actual website.

Code:
$ nslookup linuxquestions.org
Server:		192.168.1.7
Address:	192.168.1.7#53

Non-authoritative answer:
Name:	linuxquestions.org
Address: 75.126.162.205

$ nslookup example.com
Server:		192.168.1.7
Address:	192.168.1.7#53

*** Can't find example.com: No answer
My bind server is recursive, and I dont want to use other public dns servers. Also my root hints are latest.

How do I resolve my website IP address?

Thanks

NOTE: my actual website name is different. I have used example.com just for illustration only. My bind server will resolve real www.example.com.
Code:
$ nslookup example.com
Server:		192.168.1.7
Address:	192.168.1.7#53

Non-authoritative answer:
Name:	example.com
Address: 93.184.216.34

Last edited by bangnagr; 04-26-2015 at 11:10 AM.
 
Old 04-26-2015, 11:41 AM   #2
bangnagr
Member
 
Registered: Jan 2013
Posts: 48

Original Poster
Rep: Reputation: 4
Just realized Thunderbird is unable to resolve all my mail accounts. I cant even check my mails.
 
Old 04-26-2015, 12:04 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
It's been a long time since I had to deal with DNS on a day-to-day basis, but it's generally a bad idea to make two nameservers think that they're authoratative for the same domain. In this case, you have both your hosting providers nameserver and your private nameserver thinking that they're authoratative for example.com. Why do you want/need this setup? You say you don't want to use public DNS, but an internal DNS server that is not reachable from outside your network will generally only operate correctly (as far as I remember) in caching-only mode. Chances are that this is why you cannot resolve anything in example.com (including, I assume, your mail server).
 
1 members found this post helpful.
Old 04-26-2015, 01:00 PM   #4
bangnagr
Member
 
Registered: Jan 2013
Posts: 48

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by btmiller View Post
it's generally a bad idea to make two nameservers think that they're authoratative for the same domain.
Thanks for the suggestion. I changed my zone name to like 'example.local' and also changed all the host's hostname accordingly. Everything is working fine now. My bind server is now resolving everything.

Thanks
 
  


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
BIND DNS record on CENTos 5 ronalniko Linux - Networking 9 11-21-2011 06:46 AM
BIND DNS - Add host record gen2_user Linux - Newbie 4 10-14-2010 01:05 PM
BIND + MX Record Problem aeby Linux - Server 2 07-10-2007 03:00 AM
BIND - aglue record at root doronunu Linux - Networking 1 08-22-2006 11:31 AM
Bind DNS record macadam Linux - Networking 4 06-11-2005 09:18 AM


All times are GMT -5. The time now is 12:22 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration