Link to home
Start Free TrialLog in
Avatar of valleytech
valleytechFlag for United States of America

asked on

DNS configurations in linux: right/wrong?

hi all experts,

I have a linux server running behind a router (port 53 enabled, public IP 209.172.108.9) whose local ip is 192.168.1.2. I'd like to have this server to be a dns server to response internet requests to other web/mail servers on a different network.

1. i register 2 nameservers point toward that IP 209.172.108.9
2. my /etc/resolv.conf consisted of
nameserver 192.168.1.2
nameserver 209.81.59.3
nameserver 209.81.9.152 (these 2 are 2 dns resolvers from the ISP)

are those correct?

thanks so much
Avatar of msklizmantas
msklizmantas
Flag of Netherlands image

hi,

mostly correct, but one nameserver should be separate machine, just in case your server dies.

regards,

m
Avatar of valleytech

ASKER

thanks! another part that i'm confusing is that...when i registered namservers, i have to set its IP to be 209.172.108.9 correct? if so, then why the /etc/resolv.conf set nameserver to be 192.168.1.2
because internally (from inside network) you can connect to server using this ip: 192.168.1.2 and it is no point of connecting to it via external (which sometimes even doesn't work, depending on the router).
thanks!
if so, then I only need to activate my named.conf and point other domains to the 2 nameservers  I set. they should work?
Do i have to assign any IPs or set up A records for 2 nameservers within my dns?

ASKER CERTIFIED SOLUTION
Avatar of msklizmantas
msklizmantas
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks again!
do u mind for another dumb question?
can one public IP have 2 namservers registered on it?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks somuch for your clear explanation. I was able to understand more about DNS functionality
below is my zone file for domain.com with name nameservers at dns1.mynameserver.net (209.172.108.9) and dns2.mynameserver.net (209.172.108.10)  
web/mail server is located at x.y.z.w

does it look allright? sofar it is working fine. just to make sure ;) .thanks.11

; Zone file for domain.com
$TTL 14400
@      86400    IN      SOA     dns1.mynameserver.net. email@yahoo.com. ( 2007071109      ; serial, todays date+todays
                86400           ; refresh, seconds
                7200            ; retry, seconds
                3600000         ; expire, seconds
                86400 )         ; minimum, seconds

domain.com. 86400 IN NS dns1.mynameserver.net.
domain.com. 86400 IN NS dns2.mynameserver.net.

domain.com.       IN A 209.172.108.9
domain.com.       IN MX 25 domain.com.

mail IN CNAME domain.com.
www IN CNAME domain.com.
ftp IN A x.y.z.w
hi,

yes it looks fine.

m
just a note:

you are to replace the part "serial, todays date+todays" with the actual value
also when you write
domain.com.       IN MX 25 domain.com.

the 25 is the PRIORITY of the email server. that is usually 10, 20 , 30 etc. so when the first priority email server is down, email can go to the secondary priority server. in your case you have only one email server and is USUAL to have it with priority 10 (although not needed, and your setup is fine). when I saw "25" I wanted to make clear is not the PORT where you expect email, but the priority.

other than that... your setup looks good
thanks !!!