Jump to content

named - is it really running or not? [solved]


gjmwalsh
 Share

Recommended Posts

This is my final attempt to make use of Mandriva's named server.

 

I am thoroughly confused as to whether the thing is really running or not.

 

The system in outline:

 

Server connected to the internet via 2WIRE with NAT firewalling.

nmap clearly shows ports 53 and 953 are both open.

 

The following changes were made in the Mandriva distributed files:

 

/etc/named.conf: the Primary and Secondary DNS addresses from my provider were shown as forwarders.

 

In the zone files:

db.dscdirectionalservices.com.hosts: Inserted 2 lines - IN MX !0 mailx.dscdirectionalservices.com. AND mailx.dscdirectionalservices.com IN A 192.168.1.100

db.1.168.92.hosts: Added: 100 IN PTR mailx.dscdirectionalservices.com.

 

/etc/hosts reads:

127.0.0.1 localhost.localdomain localhost

192.168.1.64 www.dscdirectionalservices.com www (the NAT assigned by 2WIRE for the actual IP)

192.168.1.100 mailx.dscdirectionalservices.com mailx

 

ifconfig -a reports both eth0 and eth1 as being UP with their correct addresses.

 

To simplify things, I have removed shorewall, iptables, ipset, mandi and mandi-ifw while I troubleshoot this. I question the need for them with the 2WIRE in any case.

 

Now the mystery:

 

service named status returns: rndc: connection to remote host closed

 

ps -ef " grep named returns: (pid) 4579 named -u named -t /var/lib/named

BUT running find for "*named.pid" returns nothing.

FURTHERMORE:

Running /etc/rc/d/init.d/named status returns -: the same error as for service named status (above)

Running /etc/rc.d/init.d/named stop also returns -: the same error

Running /etc/rc.d/init.dnamed start returns -: already running

 

Is it, and if so what would it be called????

 

I have tried for days to make this work. The only part of Mandriva I have never been able to get to function at all. I have been able to build DNS from tarball without problems and just didn't want to give up on this without a final fight.

 

By the way, I have been using Mandriva for 5 years now .... I show as 'new' because I periodically change my emailaddress to reduce the load on spamassassin.

Edited by gjmwalsh
Link to comment
Share on other sites

Check the log files and see if there are any errors. You can find these in /var/log and it could be named.log or something like that. Alternatively, look in /var/log/messages after starting the service.

 

Also, check locally if DNS is working by testing if it resolves the host names/domain names you want it to resolve.

Link to comment
Share on other sites

Check the log files and see if there are any errors. You can find these in /var/log and it could be named.log or something like that. Alternatively, look in /var/log/messages after starting the service.

 

Also, check locally if DNS is working by testing if it resolves the host names/domain names you want it to resolve.

 

Thanks for showing interest in my plight!

 

I made one change: in /etc/hosts I have changed www from the nat'd address 192.168.1.64 to the actual IP 142.179.103.0 and for the moment I have removed the mx address as well to 'keep it simple'

 

Rebooted ....

 

/var/log/messages shows bind being started, and listening to 127.0.0.1 and eth0 on 192.168.1.64, both via port #53

 

zones are accessed and then named reports 'invalid command from 127.0.01"59234: bad auth

 

What can I do about named not recognizing local host? drakwizard would not begin to set up dns until I had explicitly set the host name!

 

dig does return the correct records for the directionalservices.com domain

 

BUT the rndc status (or service named status) still sing the old refrain, even though there is now a /var/lib/named/var/run/named.pid file with the same pid# as outputted from running 'ps -ef | grep named'.

Link to comment
Share on other sites

The hostname should be set against 127.0.0.1 in the /etc/hosts file. Don't put a real IP here as there is no point since it'll just go to your network card, and then come back anyway. If it's the host entry on the machine itself, always allocate against 127.0.0.1. Something like:

 

127.0.0.1 mymachine.mydomain.com mymachine localhost

 

and nothing else that relates to your machine or any IP address. Then try again with DNS.

Link to comment
Share on other sites

Well, one problem was that Drakwizard, in generating /etc/named.conf, neglected to include the include line for etc/rndc.key.

 

That taken care of, it created the 2 required zone files and altered /etc/hosts.

 

So is that wrong too?

 

What I really want out of all this is simply an MX record I can reach for sendmail's use. Having extra nics and no other computers i used them to set up static ips of 192.168.2.1 which Drakwizard made use of, and then I manually added the MX and PTR records for mail.

Link to comment
Share on other sites

Normally, it's very easy to set up MX records. Do:

 

service named status

 

from the command line and see if it says it's running. If it is, then named is OK, and you just need to configure a zone file. This is one I did in Gentoo, but the process is the same.

 

#(this stops the actual version number being reported)
version "Linux Solutions DNS Server";

forwarders {
	# place your external dns here
	123.123.123.123;
	};

#(this normally says 127.0.0.1, change to IP of Server)
listen-on { 10.1.1.10; };

zone "linuxsolutions.org" IN {
	type master;
	file "/etc/bind/pri/linuxsolutions.org.zone";
	allow-query {any;};
	allow-update {none;};
};

 

that is what you put in /etc/named.conf so that you can query the domain you want to set up for. Then, you need to create the /etc/bind/pri/linuxsolutions.org.zone file. Please change this path, etc, etc to whatever domain you want to use. This is the zone file:

 

$TTL 14400

@	IN SOA ns1.linuxsolutions.org. admin.linuxsolutions.org. (
2005123001; serial yyyymmddvv (vv = version for increment on changes)
7200	; refresh
7200	; retry
604800	; expire
86400 )	; minimum

linuxsolutions.org.		IN	NS	ns1.linuxsolutions.org.
ns1.linuxsolutions.org.		IN	NS	10.1.1.10
linuxsolutions.org.		IN	A	123.123.123.123
mail.linuxsolutions.org.		IN	A	10.1.1.10
linuxsolutions.org.		IN	MX 5	mail.linuxsolutions.org.
www.linuxsolutions.org.		IN	CNAME	linuxsolutions.org.
webmail.linuxsolutions.org.	IN	A	10.1.1.10

 

so, what's that zone file doing. First bit is setting up the domain name server ns1.linuxsolutions.org and the email address. notice at the end of each domain line there is a full stop . you have to put this else it won't work. It's correct formatting for the file. You'll see how it should be above. Now, the entries.

 

First two entries is setting up the name server itself. Third is where you put the external web address for your domain name, or an internal one if you have your web server locally. Fourth entry assigns the IP address to use for the mail record and the fifth creates the MX record. The number 5 is priority. If you put a second entry of MX 10 and a different IP address, you'll have a failover in case the first server cannot be contacted. The sixth entry creates an alias for the www.whateverdomain.com to the domain name without the subdomain entry meaning it keeps it nice and clean instead of typing IP addresses for each entry. The seventh creates a subdomain for webmail. I could have also used a CNAME here, or alternatively you can put a different server if you have the web interface separate from the mail server.

 

That's probably more than you need to know for the email stuff, but at least you've got extra info if you want to set up additional services.

Link to comment
Share on other sites

Appreciate your guidance, VERY much.

 

I used your template to rework the zone file in place of the Mandriva one.

 

In summary, it now looks like this (with dscdirectionalservices abbreviated to dsc)

 

dsc.com. IN NS ns1.dsc.com.

ns1.dsc.com. IN NS 192.168.1.65

dsc.com. IN A 192.168.1.65

mail.dsc.com. IN A 192.168.1.65

dsc.com. IN MX 5 mail.dsc.com.

www.dsc.com. IN CMAME dsc.com.

 

dig shows the MX record pointing to www.dscdirectionalservices.com on the internet.

 

email is now working.

 

Only the 1 nic card runs from the 2WIRE gateway.

/etc/hosts still shows 127.0.0.1 localhost.localdomain localhost and 192.168.1.65 www.dscdirectionalservices.com www

 

sendmail parsing is also running: ie my email address shows as gjwalsh@dscdirectionalservices.com.

 

My concern is with the 192.168.1.65.

This is the IP masquerading via the 2WIRE of our public static IP address. It won't change, of course, but I am concerned about the 192.168.1.65 changing without my being aware and bringing the system down.

 

In the past, I had control of /etc/resolv.conf and ran everything with 2 nic cards, one to the internet and the other the local lan which provide the ns1 and mx functionality. Now, 2WIRE overwites it.

 

Maybe this is okay .. I'm just a little nervous about it. Seems shaky to me although it DOES work, thanks to your help in cleaning out the cobwebs of confusion in my head.

Link to comment
Share on other sites

Thanks for the reassurance on that one, and for seeing me through this. I take some pleasure in the much simpler physical setup and can now get on with my psych project which is really what I am all about.

 

And now I have a completely Mandriva system.

 

If I could, I would shake your hand for your help.

 

George

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...