LinuxQuestions.org
Register a domain and help support LQ
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 11-12-2009, 04:31 AM   #1
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
host hostname not working ?


Hi all....

I have setup a dns in vinay.linux.com server

I am able to ping Rohit.linux.com and vinay.linux.com from both the servers...

but from vinay.linux.com its recognizing the host

Code:
[root@TEG named]# host Rohit.linux.com
Rohit.linux.com has address 172.17.65.206
works fine

but from Rohit.linux.com

Code:
[root@localhost mail]# host Rohit.linux.com
;; connection timed out; no servers could be reached
why is this..?
can anyone please help me....
Thanks in advance...
 
Old 11-12-2009, 05:55 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by vinaytp View Post
Hi all....

I have setup a dns in vinay.linux.com server

I am able to ping Rohit.linux.com and vinay.linux.com from both the servers...

but from vinay.linux.com its recognizing the host

Code:
[root@TEG named]# host Rohit.linux.com
Rohit.linux.com has address 172.17.65.206
works fine

but from Rohit.linux.com

Code:
[root@localhost mail]# host Rohit.linux.com
;; connection timed out; no servers could be reached
why is this..?
can anyone please help me....
Thanks in advance...
use host -v or dig to see which dns server, if any each machine is querying.
 
Old 11-12-2009, 07:45 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by centosboy View Post
use host -v or dig to see which dns server, if any each machine is querying.
Thanks centosboy...

host -v or dig all returning same error...But i am able to ping to vinay.linux.com and Rohit.linux.com

also

telnet Rohit.linux.com 80 connects fine..
Anyone please..?
 
Old 11-12-2009, 07:51 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
telnet Rohit.linux.com 80 connects fine..
DNS uses port 53
 
Old 11-12-2009, 08:00 AM   #5
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by repo View Post
DNS uses port 53
Even

Code:
telnet Rohit.linux.com 53
is working
But
Code:
host Rohit.linux.com
is returning error message..That is my question ?

Last edited by vinaytp; 11-12-2009 at 08:01 AM.
 
Old 11-12-2009, 08:05 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
What is the output from
Code:
cat /etc/resolv.conf
nslookup Rohit.linux.com
at [root@localhost mail]#
 
Old 11-12-2009, 08:31 AM   #7
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by vinaytp View Post
Thanks centosboy...

host -v or dig all returning same error...But i am able to ping to vinay.linux.com and Rohit.linux.com

also

telnet Rohit.linux.com 80 connects fine..
Anyone please..?

dig rohit.linux.com - with this command the dns server used in the query is noted right down near the bottom of the command output.


dig @vinay.linux.com rohit.linux.com - with this commmand you are actually specifying the server to do the dnslookup.

yes, we also need to know what is in your /etc/resolv.conf and your /etc/hosts files
 
Old 11-12-2009, 08:32 AM   #8
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by repo View Post
What is the output from
Code:
cat /etc/resolv.conf
nslookup Rohit.linux.com
at [root@localhost mail]#
Thanks for your reply repo..

Code:
[root@localhost mail]# cat /etc/resolv.conf 
# generated by NetworkManager, do not edit!
nameserver 172.17.70.143
nameserver 172.17.64.78
nameserver 172.17.9.25
Here first name server is ip of my dns...

Code:
[root@localhost mail]# nslookup Rohit.linux.com
;; Got recursion not available from 172.17.70.143, trying next server
;; Got SERVFAIL reply from 172.17.64.78, trying next server
;; Got recursion not available from 172.17.70.143, trying next server
;; connection timed out; no servers could be reached
But I am able to ping to Rohit.linux.com
also

Code:
[root@localhost mail]# telnet Rohit.linux.com 25
Trying 172.17.65.206...
Connected to Rohit.linux.com.
Escape character is '^]'.
220 Rohit.linux.com ESMTP Sendmail 8.14.2/8.14.2; Thu, 12 Nov 2009 18:58:04 +0530
cat /etc/hosts
Code:
172.17.70.143 vinay.linux.com localhost.localdomain localhost vinay
127.0.0.1 localhost.localdomain localhost
172.17.65.206 Rohit.linux.com   Rohit
Please help me...

Last edited by vinaytp; 11-12-2009 at 08:35 AM.
 
Old 11-12-2009, 11:29 AM   #9
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
It seems like a problem with your DNS configuration. It works fine for Rohit and vinay hostnames, because they're "translated" to IP addresses through your /etc/hosts file. If you were to comment out the 1st and 3rd line of /etc/hosts, then they too would fail.

Quote:
;; Got recursion not available from 172.17.70.143, trying next server
You'll need to solve this issue in your DNS.

If you administer the DNS system, you can try enabling recursion (even if only for your computer).
Have a look for instance at
http://<br /> http://forums.opensuse...kup.html<br />
 
Old 11-12-2009, 11:37 AM   #10
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by vinaytp View Post
Thanks for your reply repo..

Code:
[root@localhost mail]# cat /etc/resolv.conf 
# generated by NetworkManager, do not edit!
nameserver 172.17.70.143
nameserver 172.17.64.78
nameserver 172.17.9.25
Here first name server is ip of my dns...

Code:
[root@localhost mail]# nslookup Rohit.linux.com
;; Got recursion not available from 172.17.70.143, trying next server
;; Got SERVFAIL reply from 172.17.64.78, trying next server
;; Got recursion not available from 172.17.70.143, trying next server
;; connection timed out; no servers could be reached
But I am able to ping to Rohit.linux.com
also

Code:
[root@localhost mail]# telnet Rohit.linux.com 25
Trying 172.17.65.206...
Connected to Rohit.linux.com.
Escape character is '^]'.
220 Rohit.linux.com ESMTP Sendmail 8.14.2/8.14.2; Thu, 12 Nov 2009 18:58:04 +0530
cat /etc/hosts
Code:
172.17.70.143 vinay.linux.com localhost.localdomain localhost vinay
127.0.0.1 localhost.localdomain localhost
172.17.65.206 Rohit.linux.com   Rohit
Please help me...

post your /etc/named.conf pls
 
Old 11-12-2009, 10:39 PM   #11
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by centosboy View Post
post your /etc/named.conf pls
Thanks to all...Still struggling

named.conf file

Code:
options {
//      listen-on port 53 { 127.0.0.1; };
//      listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
      statistics-file "/var/named/data/named_stats.txt";
    //    memstatistics-file "/var/named/data/named_mem_stats.txt";
//      allow-query     { localhost; };
//      recursion yes;
};

controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.ca";
};
zone "linux.com" IN {
        type master;
        file "vinay.linux.com";
        allow-update { none; };
};
include "/etc/rndc.key";
My vinay.linux.com file

Code:
;zone file for 'fedorabook.com'

; Default TTL is 1 hour
$TTL	1H	

; start of authority

@	SOA	ns1	localhost (
		2007201706  ; serial number
		3D 	    ; refresh
		1H          ; retry
		3D	    ; expire
		1H )	    ; minimum

; Nameservers
		IN	NS	vinay
;	IN	NS	darkday

; Addresses of hosts
vinay	IN	A	172.17.70.143
Rohit   IN 	A	172.17.65.206
;darkday	IN	A	216.183.93.225

; Mail exchangers
@	IN 	MX	10 vinay
@	IN	MX	20 Rohit

; Nicknames/aliases
;mail	IN	CNAME	bluesky
;www	IN	CNAME	bluesky
;ww	IN	CNAME   bluesky
;wwww	IN	CNAME	bluesky
Even if i comment entries of Rohit and vinay in /etc/resolve.conf file ping works fine with both vinay.linux.com and Rohit.linux.com

Last edited by vinaytp; 11-12-2009 at 10:50 PM.
 
Old 11-13-2009, 02:38 AM   #12
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Uncommenting the line
Code:
//      recursion yes;
would eliminate the error message. But make sure to read up on DNS configuration to check
the impact before you actually make the change!
I'm not a DNS expert, so I can't tell if it opens up a Pandora box.
 
Old 11-13-2009, 03:47 AM   #13
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by timmeke View Post
Uncommenting the line
Code:
//      recursion yes;
would eliminate the error message. But make sure to read up on DNS configuration to check
the impact before you actually make the change!
I'm not a DNS expert, so I can't tell if it opens up a Pandora box.
not only the above...i can see a number of issues with your conf file.


1. it is supposed to be listening on port 53...uncomment that line.......and not only on localhost

2. allow query...uncomment that line and enter all the hosts/ips that are allowed to query this dns


basically it should look more like this


Code:
options {
      listen-on port 53 { 127.0.0.1; 192.168.x.x; };
//      listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
      statistics-file "/var/named/data/named_stats.txt";
    //    memstatistics-file "/var/named/data/named_mem_stats.txt";
     allow-query     { localhost; 192.168.x.x; 192.x.x.x };
      recursion yes;
};

controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.ca";
};
zone "linux.com" IN {
        type master;
        file "vinay.linux.com";
        allow-update { none; };
};
include "/etc/rndc.key";

restart named after making changes


you are simply allowing nothing to access this dns server..


please read the bind documentation to get you going....it is what the rest of us do

Code:
http://tldp.org/HOWTO/DNS-HOWTO-1.html

Im afraid you cant just get this all going smoothly without first reading *some* kind of documentation.
 
Old 11-13-2009, 06:28 AM   #14
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Thanks a loooot timmeke and centosboy....

It worked...

Thanks again...
 
  


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
Hostname: Unknown Host ?? I'm very confused Rampage2884 Linux - Networking 12 11-10-2010 08:18 AM
Sun VirtualBox: Guest is Unable to Connect to Host By Hostname Cottonwoody Linux - Virtualization and Cloud 5 11-13-2009 12:31 PM
Accessing host over hostname is not possible, but all related to dns seems ok sarajevo Linux - Networking 1 05-22-2008 03:14 PM
HostName: Host Name Lookup failire SuSE 9.0 DNS problem? direct2bebop Linux - Networking 1 01-17-2005 03:29 AM
startkde eroor - hostname: Host name lookup failure slavix Debian 6 08-10-2004 05:56 PM


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