Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Are you saying that ns1 and ns2 should return different IP's? Why do you expect an internal query to return ns1 in preference to ns2 if that's the case?
Change your zone file so that only ns1 can be returned and see what happens.
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Ok this is the strange part maybe I'm doing something wrong I don't know, however;
previously I had my router acting as the local DNS server so that internally my domain.com would resolve without even needing to contact the WAN DNS servers for my domain which are provided by the company I got my domain from. So to make it clear ns1 and ns2 .active-dns.com were the DNS servers acting for anyone outside my local subnet.
Now I am trying to do the same with my server, as the router was becoming too overloaded acting as router/gateway + DNS server + telnet and SSH server all at once.
All I want really is that when I do say an nslookup of mydomain.com I get the correlating IP address not my WAN address!
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
To me this means that the DNS server is running passivly not actively, maybe authority is the right word here but certainly it's just resolving not hosting I guess!!
You have me a bit confused. You have 4 nameservers listed in yoru zone file. Are you saying some of these resolve to external IP's and some to internal?
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Hehe, sorry I think I got myself confused more then you!
I modified the zone files;
Code:
;
; BIND data file for example.com
;
$TTL 604800
@ IN SOA ns1.optiplex-networks.com. info.optiplex-networks.com. ( 2008092201 ; Serial
7200 ; Refresh
120 ; Retry
2419200 ; Expire
604800) ; Default TTL
;
@ IN NS ns1.optiplex-networks.com.
optiplex-networks.com. IN MX 10 mail.optiplex-networks.com.
optiplex-networks.com. IN A 192.168.1.50
gx110.optiplex-networks.com. IN A 192.168.1.51
www.optiplex-networks.com IN A 192.168.1.50
mail.optiplex-networks.com IN A 192.168.1.50
ftp.optiplex-networks.com IN A 192.168.1.51
mail.gx110.optiplex-networks.com IN A 192.168.1.51
ferrari3200.optiplex-networks.com IN A 192.168.1.5
optiplex-networks.com. IN TXT "v=spf1 ip4:192.168.1.50 a mx ~all"
mail IN TXT "v=spf1 a -all"
Code:
$TTL 1d ;
$ORIGIN 254.168.192.IN-ADDR.ARPA.
@ IN SOA ns1.optiplex-networks.com. info.optiplex-networks.com. (
2008092101
7200
120
2419200
604800
)
IN NS ns1.optiplex-networks.com.
1 IN PTR ns1.optiplex-networks.com.
I just want 1 DNS server basically on my network to perform lookups for my local domain and also to translate WAN domain info. Exactly like my Cisco router was performing.
I guess describing by bad sudo code:
{
If domain on LAN then resolve to local IP
or If not on LAN then resolve to WAN
}
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Hmm... originally I had ns1 and ns2 being set to my main server and router. However the router acted as a master for local domain within my LAN so then Win clients were fine resolving both but of course Linux boxes didn't like it.
The other two name servers where for my ISP which if I'm going to have my own DNS I guess I don't need.
Today I took the routers internal DNS server offline so now I am just left with my main server.
Since when I ping from local machine to say my webserver I resolve the WAN IP address as the DNS information seems to be supplied by the external DNS servers directing WAN users to my WAN IP instead of my local DNS server directing the local machine to the web servers internal IP.
Ok, so on the machine you are trying to resolve from, you have the correct nameserver in resolv.conf (if you are digging from the same machine, do you have an external IP or are you using localhost).
Can you reposr the zone file, and the output of dig?
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
forward zone file:
Code:
;
; BIND data file for example.com
;
$TTL 604800
@ IN SOA ns1.optiplex-networks.com. info.optiplex-networks.com. ( 2008092201 ; Serial
7200 ; Refresh
120 ; Retry
2419200 ; Expire
604800) ; Default TTL
;
@ IN NS ns1.optiplex-networks.com.
optiplex-networks.com. IN MX 10 mail.optiplex-networks.com.
optiplex-networks.com. IN A 192.168.1.50
gx110.optiplex-networks.com. IN A 192.168.1.51
www.optiplex-networks.com IN A 192.168.1.50
mail.optiplex-networks.com IN A 192.168.1.50
ftp.optiplex-networks.com IN A 192.168.1.51
mail.gx110.optiplex-networks.com IN A 192.168.1.51
ferrari3200.optiplex-networks.com IN A 192.168.1.5
optiplex-networks.com. IN TXT "v=spf1 ip4:192.168.1.50 a mx ~all"
mail
reverse zone file:
Code:
$TTL 1d ;
$ORIGIN 254.168.192.IN-ADDR.ARPA.
@ IN SOA ns1.optiplex-networks.com. info.optiplex-networks.com. (
2008092101
7200
120
2419200
604800
)
IN NS ns1.optiplex-networks.com.
1 IN PTR ns1.optiplex-networks.com.
dig @localhost optiplex-networks.com
Code:
; <<>> DiG 9.3.4-P1.1 <<>> @localhost optiplex-networks.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27298
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0
;; QUESTION SECTION:
;optiplex-networks.com. IN A
;; ANSWER SECTION:
optiplex-networks.com. 2274 IN A 81.178.2.118
;; AUTHORITY SECTION:
optiplex-networks.com. 5649 IN NS ns1.active-dns.com.
optiplex-networks.com. 5649 IN NS ns2.active-dns.com.
;; Query time: 178 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Sep 23 02:57:11 2008
;; MSG SIZE rcvd: 102
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Oops that was for main server hang on!
resolv.conf file of localhost (Vaio)
Code:
# generated by NetworkManager, do not edit!
nameserver 192.168.1.51
search optiplex-networks.com
dig @localhost optiplex-networks.com
Code:
; <<>> DiG 9.3.4-P1.1 <<>> @localhost optiplex-networks.com
; (1 server found)
;; global options: printcmd
;; connection timed out; no servers could be reached
I'm about to show my lack of knowledge of DNS here. I got mine working fine, but I needed a lot of help from a howto some time ago, and my zone files are in a different format from yours.
However, I don't see quite how you nameserver is meant to resolve. Try adding an A record (or cname if you want) for ns1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.