LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-15-2009, 09:22 AM   #1
terrytibbs
Member
 
Registered: Jul 2009
Distribution: Solaris (SCSA), Red Hat (RHCT)
Posts: 47

Rep: Reputation: 16
DNS Question from Noobie


Hi,

I am running Fedora 11 on two servers.

1 x Host connected to the internet through a wireless router.
1 x Client wired to my host using a crossover cable. Not on the internet.

I want my client to communicate with the host using ping, ssh, ftp, telnet etc using hostname not just IP.

I could just add the hostnames and IP’s in /etc/hosts on both systems.

But I would like use DNS to resolve hostname to IP!

Can I have make my host into a DNS server for my mini network?
So it resolves name to IP for any internal clients?

Is DNS the best way or should I use NIS?

I have looked at named.conf and dnsmasq.conf are these the two files I need to concentrate on to configure the host?

Would I then edit the /etc/resolv.conf on the client so it looks at my host to resolve the IP to hostname? Have I got the wrong end of stick? Tell me!

I know it’s a stupid config but I am only playing around and learning stuff. I have no plans to put the client on the internet yet. I really just want a intranet to mess around with.


Thanks
 
Old 07-15-2009, 05:22 PM   #2
OdinnBurkni
Member
 
Registered: Feb 2007
Location: Iceland
Distribution: Fedora 14, CentOS, FreeNAS
Posts: 127

Rep: Reputation: 20
DNS

Hi.
I haven't setup a DNS for home use on Linux but I've done a few public ones. I think for this setup to work you have to setup a DNS service on your host. And for it to work automatically I think you have to have a DHCP service running on that host also. It's pretty easy to setup using yum.
I hope I didn't just confuse you...
I think you basically need a name-caching nameserver... ...think that's what it's called...
 
Old 07-17-2009, 02:10 PM   #3
terrytibbs
Member
 
Registered: Jul 2009
Distribution: Solaris (SCSA), Red Hat (RHCT)
Posts: 47

Original Poster
Rep: Reputation: 16
Don't laugh at my attempt to make an internal DNS server!!

Hello,

I am kind of getting to where I want to be...

I have 1 x HOST (192.168.0.5) and 1 x Client (192.168.0.11) both running Fedora 11.

I am now serving an web page using Apache from my Host to my Client.

I would not dare "go live" with my pityful attempt at web design so it's just for me to look at for the moment! I am learning stuff though!

Anyway, the client can only see the web page by entering the IP of the host (192.168.0.5).

I would like to use the domain name (bosslink.net)

I have added the IP of my Host to /etc/resolv.conf of my client.

I am pretty sure I edited named.conf on the Host correctly. I think the problem is with my zone;

Code:
[root@bosslink named]# named-checkzone bosslink.net bosslink.net.zone
zone bosslink.net/IN: NS 'ns1.bosslink.net.bosslink.net' has no address records (A or AAAA)
zone bosslink.net/IN: loaded serial 0
OK
[root@bosslink named]#

Here is my zone info, don't laugh as it's probably completely wrong! If someone could take a look and let me know what it's missing I would really appreciate it;

Code:
[root@bosslink named]# more bosslink.net.zone
$TTL 1D
@	IN SOA	@ bosslink.net. (
					0	; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
	IN	NS	ns1.bosslink.net
bosslink.net IN	A	192.168.0.11
	AAAA	::1
[root@bosslink named]#
I'll add anything else that may help.

Thanks
 
Old 07-18-2009, 03:30 AM   #4
OdinnBurkni
Member
 
Registered: Feb 2007
Location: Iceland
Distribution: Fedora 14, CentOS, FreeNAS
Posts: 127

Rep: Reputation: 20
Zone config

Hi there.
I wouldn't dare to laugh... ...I haven't tried to make internal DNS yet, maybe I should give it a try?
One thing I noticed about your zone config, the serial. I found out, the hard way, on my public dns that after every change you have to remember increase the serial number and restart the named service, service named restart.
Another question, are you using DHCP on the host for the client? If not did you set the host as the nameserver on the client?
 
Old 07-20-2009, 08:07 AM   #5
terrytibbs
Member
 
Registered: Jul 2009
Distribution: Solaris (SCSA), Red Hat (RHCT)
Posts: 47

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by OdinnBurkni View Post
Another question, are you using DHCP on the host for the client? If not did you set the host as the nameserver on the client?
Firstly, thanks for replying to my thread!

I am not using DHCP. I have static addresses on the Client and Host. My /etc/resolv.conf on the Client looks like this;

Code:
[root@GX150 ~]# more /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.0.5
I also have nsswitch.conf set as "files dns" for host lookups.

I sorted out the contents of the zone file on the Host, so named-checkzone no longer gives me an error, it now looks like this;


Code:
[root@bosslink named]# more bosslink.net.zone
$ORIGIN .
$TTL 38400	; 10 hours 40 minutes
bosslink.net		IN SOA	bosslink.net.local. hostmaster.bosslin
k.net.local. (
				2006022020 ; serial
				10800      ; refresh (3 hours)
				3600       ; retry (1 hour)
				604800     ; expire (1 week)
				38400      ; minimum (10 hours 40 minu
tes)
				)
			NS	bosslink.net.local.
$ORIGIN bosslink.net
bosslink.net			A	192.168.0.5
www			CNAME	bosslink.net

[root@bosslink named]# named-checkzone bosslink.net bosslink.net.zone
zone bosslink.net/IN: loaded serial 2006022020
OK
[root@bosslink named]#

However, I still can't see my web page by typing "bosslink.net" from the Client, I can only see it when I type in the IP address.

Dumb question, but do I need bind running on the Client as well? 'cus at the moment it ain't!

How can I test if DNS is working on either the Client or the Host? I don't know if the problem is with the Client or Host.

This is what I get when dig the Host from the Client;

Code:
[root@GX150 ~]# dig 192.168.0.5

; <<>> DiG 9.6.1rc1-RedHat-9.6.1-0.4.rc1.fc11 <<>> 192.168.0.5
;; global options: +cmd
;; connection timed out; no servers could be reached

Cheers
 
Old 07-20-2009, 09:15 AM   #6
adm1329
Member
 
Registered: Mar 2004
Distribution: CentOS 5
Posts: 128

Rep: Reputation: 17
Is your firewall on the host blocking port 53?
 
Old 07-20-2009, 10:55 AM   #7
terrytibbs
Member
 
Registered: Jul 2009
Distribution: Solaris (SCSA), Red Hat (RHCT)
Posts: 47

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by adm1329 View Post
Is your firewall on the host blocking port 53?
Nope, I have enabled DNS on the Firewall for both Client and Host.

(I also tried turning the firewall off to see if it worked, it didn't)

Thanks for replying though.
 
Old 07-20-2009, 11:05 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Is the daemon running?
 
Old 07-20-2009, 12:24 PM   #9
terrytibbs
Member
 
Registered: Jul 2009
Distribution: Solaris (SCSA), Red Hat (RHCT)
Posts: 47

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jschiwal View Post
Is the daemon running?
Yes, named is running on the Host.

What daemon(s) need to be running on the Client?

Thanks
 
Old 07-20-2009, 02:22 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The error message seemed consistent with a non-running service or a connection problem.
By the way, you need to open both 53/udp and 53/tcp. If the domain name is too long for a udp packet, tcp is used instead. Double check that you opened the both ports.

A daemon isn't needed for on the client. You do need to check the /etc/resolv.conf and /etc/nsswitch.conf files. Sometimes a daemon like avahi-daemon and avahi-dnsconfd are used.

You can check if these files are OK with "getent hosts <hostname>", but that would require a working DNS.

example: "getent hosts desktopname" or "getent hosts www.google.com".

---

Given the small size of your network, a more reasonable solution (besides maintaining /etc/hosts) could be to use dnsmasq instead. You could maintain a single /etc/hosts file on the dnsmasq server for your local network and forward queries for Internet addresses to the DNS server listed in /etc/resolv.conf.

Last edited by jschiwal; 07-20-2009 at 05:24 PM.
 
Old 07-21-2009, 04:23 PM   #11
OdinnBurkni
Member
 
Registered: Feb 2007
Location: Iceland
Distribution: Fedora 14, CentOS, FreeNAS
Posts: 127

Rep: Reputation: 20
DNS problem

Ok. I'm not sure I've got the answer but here are some thoughts.

Code:
$ORIGIN .
$TTL 38400	; 10 hours 40 minutes
bosslink.net		IN SOA	bosslink.net.local. hostmaster.bosslin
k.net.local. (
				2006022020 ; serial
				10800      ; refresh (3 hours)
				3600       ; retry (1 hour)
				604800     ; expire (1 week)
				38400      ; minimum (10 hours 40 minu
tes)
				)
			NS	bosslink.net.local.
$ORIGIN bosslink.net
bosslink.net			A	192.168.0.5
www			CNAME	bosslink.net

[root@bosslink named]# named-checkzone bosslink.net bosslink.net.zone
zone bosslink.net/IN: loaded serial 2006022020
OK
[root@bosslink named]#
In my public DNS files I have a dot behind $ORIGIN bosslink.net. Like that.
Another thing. In my files it would look like this...
Code:
[root@bosslink named]# more bosslink.net.zone
$ORIGIN .
$TTL 38400	; 10 hours 40 minutes
bosslink.net		IN SOA	bosslink.net. hostmaster.bosslin
k.net. (
				2006022020 ; serial
				10800      ; refresh (3 hours)
				3600       ; retry (1 hour)
				604800     ; expire (1 week)
				38400      ; minimum (10 hours 40 minu
tes)
				)
			NS	bosslink.net.
bosslink.net.		A	192.168.0.5
$ORIGIN bosslink.net
www			CNAME	bosslink.net.
Like I said, not sure if that solves it but it's worth trying... ...and don't forget to change the serial number and to restart named...

Regards,
Odinn Burkni

Last edited by OdinnBurkni; 07-21-2009 at 04:27 PM.
 
Old 07-25-2009, 11:30 AM   #12
terrytibbs
Member
 
Registered: Jul 2009
Distribution: Solaris (SCSA), Red Hat (RHCT)
Posts: 47

Original Poster
Rep: Reputation: 16
It works!

I finally got this working!!

I must point out that I changed my hostname to vhost1, but my domain name is still bosslink.net. I was not 100% sure if there was a naming issue going on, as all the tutorial's I read used FQDN's.

There were a few problems, first I had to tell my Host to listen using the IP address of eth0 in /etc/named.conf;

Code:
options {
	listen-on port 53 { 127.0.0.1; 192.168.0.10; };
Then I restarted named, but dig would not yield any results unless I specified local host;

Code:
dig @localhost +short NS bosslink.net
This is where I lost the plot;

When I checked my /var/log/messages there was a zone being loaded with a serial number of 0. This was not my zone!!! Oh no, it wasn't my zone people! Who's ruddy zone was this? On my lan? I had changed the serial number of bosslink.net.zone to #3. So where the hell was this zone coming from?

Anyway, after a long long time. I found it was in fact named.local that was being loaded. Yes, I know. I was shocked as well.

So, where was I? Oh yes, I had a good look through /etc/named.conf
and I found a couple of things;

Code:
zone "bosslink.net" IN {
        type hint;
        file "bosslink.net.zone";

From reading about a thousand DNS How to's and tutorials, I was sure that type should have been master and not hint

So, I changed it and restarted named;

Code:
Error in named configuration:
/etc/named.rfc1912.zones:13: zone 'bosslink.net': already exists previous definition: /etc/named.conf:31
                                                           [FAILED]

Hmmm, I thought. I have nothing else to try, I don't really know if what I have already tried is actually correct. For all I know, I've edited the wrong lines in the wrong files and made a complete mess of this. All the well written tutorials I read had used different config's, all the tutorials the were relevant made absolutely no sense at all.

Though, not one to give up, I thought I'd comment the below line out of /etc/named.conf and restart named

Code:
include "/etc/named.rfc1912.zones";
It worked, I have no idea why this line was stopping my bosslink.net.zone from being loaded.

But it now works, I can now access www.bosslink.net from my Client.

Thanks for your help

much love
 
  


Reply



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
Noobie Command Question help!! pheardotcom Linux - Newbie 3 10-29-2008 09:23 PM
Noobie rpm question itz2000 Linux - Newbie 4 08-31-2007 06:37 PM
smart noobie question alaios SUSE / openSUSE 1 10-27-2006 10:03 AM
noobie up2date question zarnold Red Hat 3 09-02-2006 10:10 PM
noobie question about rc.d file bob cashman Ubuntu 3 07-15-2005 10:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:15 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