LinuxQuestions.org
Visit Jeremy's Blog.
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 07-17-2014, 10:14 AM   #1
johnmaxwell
LQ Newbie
 
Registered: Feb 2014
Posts: 20

Rep: Reputation: Disabled
DNS not resolving


in my pc when i ssh with my server ip i can log in but when i ssh to add.server.local which in my server name i cant not following is the needed files. Please help me......

Code:
nslookup add.server.local
Server:		115.127.27.60
Address:	115.127.27.60#53

Name:	add.server.local
Address: 192.168.100.1
Code:
cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=add.server.local
DOMAIN=server.local
NTPSERVERARGS=iburst
Code:
cat /etc/resolv.conf
# Generated by NetworkManager
search server.local
nameserver 115.127.27.60
nameserver 192.168.100.1
Code:
cat /etc/hosts
127.0.0.1		localhost.localdomain localhost
::1	localhost.localdomain	localhost6	localhost
115.127.27.60	add.server.local	add
Code:
cat /etc/sysconfig/network-scripts/ifcfg-Auto_p4p1
TYPE=Ethernet
BOOTPROTO=none
IPADDR=115.127.27.60
PREFIX=29
GATEWAY=115.127.27.60
DNS1=115.127.27.60
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Auto p4p1"
UUID=d71adf47-fce2-4bf1-9d8a-a7544ae1f682
ONBOOT=yes
DOMAIN="server.local"
HWADDR=10:FE:ED:07:A8:AD
LAST_CONNECT=1404998315
USERCTL=no
PEERDNS=yes
Code:
cat /etc/sysconfig/network-scripts/ifcfg-Auto_p4p2
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.100.1
PREFIX=24
GATEWAY=192.168.100.1
DNS1=192.168.100.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Auto p4p2"
UUID=45d9caf0-ba55-4278-8246-b43686b6369b
ONBOOT=yes
LAST_CONNECT=1404903340
HWADDR=64:66:B3:02:8C:5F
USERCTL=no
Code:
cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
	listen-on port 53 { 115.127.27.60; 192.168.100.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; 192.168.100.0/24; };
	recursion yes;

	dnssec-enable yes;
	dnssec-validation yes;
	dnssec-lookaside auto;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.iscdlv.key";

	managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
	type hint;
	file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
Code:
cat /etc/named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package 
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (c)2007 R W Franks
// 
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "localhost.localdomain" IN {
	type master;
	file "named.localhost";
	allow-update { none; };
};

zone "localhost" IN {
	type master;
	file "named.localhost";
	allow-update { none; };
};

zone "server.local" IN {
	type master;
	file "fwd.add";
	allow-update { none; };
};

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
	type master;
	file "named.loopback";
	allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
	type master;
	file "named.loopback";
	allow-update { none; };
};

zone "0.in-addr.arpa" IN {
	type master;
	file "named.empty";
	allow-update { none; };
};

zone "100.169.192.in-addr.arpa" IN {
	type master;
	file "rev.add";
	allow-update { none; };
};
Code:
cat /var/named/
chroot/          fwd.add          named.localhost  slaves/
data/            named.ca         named.loopback   
dynamic/         named.empty      rev.add          
[root@add ~]# cat /var/named/fwd.add 
$TTL 1D
@	IN	SOA	add.server.local. root.server.local. (
					0	; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
	IN	NS	add.server.local.
	IN	A	192.168.100.1
add	IN	A	192.168.100.1
Code:
cat /var/named/rev.add 
$TTL 1D
@	IN	SOA	add.server.local. root.server.local. (
					0	; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
@	IN	NS	add.server.local.
1	IN	PTR	add.server.local.
Code:
 cat /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Thu Jul 17 19:30:18 2014
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1:136]
:POSTROUTING ACCEPT [1:136]
COMMIT
# Completed on Thu Jul 17 19:30:18 2014
# Generated by iptables-save v1.4.7 on Thu Jul 17 19:30:18 2014
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -o p4p1 -j MASQUERADE 
COMMIT
# Completed on Thu Jul 17 19:30:18 2014
# Generated by iptables-save v1.4.7 on Thu Jul 17 19:30:18 2014
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
:LOGGING - [0:0]
-A INPUT -i p4p1 -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -i p4p1 -p tcp -m tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT 
-A INPUT -i p4p2 -p tcp -m tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT 
-A INPUT -i p4p1 -p tcp -m tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT 
-A INPUT -i p4p1 -p tcp -m tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT 
-A INPUT -i p4p2 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -i p4p2 -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -i p4p1 -p udp -m udp --sport 53 -m state --state ESTABLISHED -j ACCEPT 
-A INPUT -i p4p2 -p udp -m udp --sport 53 -m state --state ESTABLISHED -j ACCEPT 
-A INPUT -i p4p2 -p tcp -m tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -d 192.168.100.1/32 -i p4p2 -p tcp -m tcp --sport 3389 --dport 513:65535 -m state --state ESTABLISHED -j ACCEPT 
-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 80 -m limit --limit 25/min --limit-burst 100 -j ACCEPT 
-A INPUT -j LOGGING 
-A FORWARD -i p4p2 -o p4p1 -j ACCEPT 
-A OUTPUT -o p4p1 -p tcp -m tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p1 -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p2 -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p1 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p1 -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p2 -p tcp -m tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p2 -p tcp -m tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p1 -p udp -m udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p2 -p udp -m udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -o p4p2 -p tcp -m tcp --sport 53 -m state --state ESTABLISHED -j ACCEPT 
-A OUTPUT -s 192.168.100.1/32 -o p4p2 -p tcp -m tcp --sport 513:65535 --dport 3389 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A OUTPUT -o lo -j ACCEPT 
-A OUTPUT -j LOGGING 
-A LOGGING -m limit --limit 2/min -j LOG --log-prefix "IPTables Packet Dropped: " --log-level 7 
-A LOGGING -j DROP 
COMMIT
# Completed on Thu Jul 17 19:30:18 2014
 
Old 07-17-2014, 10:30 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,116

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
So what error do you get when you:

Code:
ssh -vvv add.server.local
?
 
Old 07-17-2014, 04:04 PM   #3
johnmaxwell
LQ Newbie
 
Registered: Feb 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
this is the reply answer
Code:
john@home ~ $ ssh -vvv root@add.server.local
OpenSSH_6.2p2 Ubuntu-6, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
ssh: Could not resolve hostname add.server.local: Name or service not known
 
Old 07-17-2014, 07:48 PM   #4
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Fedora FC23, Raspbian, Ubuntu Precise via Chrome/Crouton
Posts: 355

Rep: Reputation: 42
What does "grep hosts /etc/nsswitch.conf" report?

Here is mine. I use avahi to resolve local names.

Code:
$ grep hosts /etc/nsswitch.conf
#hosts:     db files nisplus nis dns
hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname
 
Old 07-18-2014, 06:48 AM   #5
johnmaxwell
LQ Newbie
 
Registered: Feb 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
In server the reply is following...

Code:
[root@add Desktop]# grep hosts /etc/nsswitch.conf
#hosts:     db files nisplus nis dns
hosts:      files dns
 
Old 07-18-2014, 07:09 AM   #6
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,797

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
DNS failing

Stupid perhaps question: have you verified that bind is running, has picked up any table changes, and answering network queries?
 
Old 07-18-2014, 07:49 AM   #7
johnmaxwell
LQ Newbie
 
Registered: Feb 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Wink

yes bind / named is up and running.
 
Old 07-19-2014, 07:15 AM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Am a bit confused here with the output of the files you posted in the first post. Not able to find which are from the client and which are from the server. If NSLOOKUP is able to resolve DNS name then DNS server is fine the thing we need to check whether client is configured correctly or not.

I can see that you have put in an entry in /etc/hosts for add.server.local, if that is on the client then the error for resolving hostname shouldn't come at all. If that is on the server, then I would like to see the output of from the following files:

1. /etc/resolv.conf file from the client
2. ifcfg-ethX output file from the client

Also on the client end, try the following,

1. Get into nslookup
2. Change the server using server XXX.XXX.XXX.XXX (where, XXX.XXX.XXX.XXX is the IP of your DNS server
3. Try resolving and add.server.local and let us know what is the output.

From subsequent posts I can see that nsswitch is set to files,dns which is default and is fine, nothing to change there.
 
Old 07-20-2014, 12:01 AM   #9
johnmaxwell
LQ Newbie
 
Registered: Feb 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
the fact is i am trying to get my server from my home. In office i have one isp providing with real ip 115.127.27.60, when i am using another ip 115.127.27.58 my another office brunch i can not get add.server.local by name but can get it by ip 115.127.27.60.

So now my question is is it possible to get a server by its name from another brunch or from my home.

thanks
 
Old 07-20-2014, 03:57 AM   #10
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
Sure, there's a way to do it. There are lots of ways to do it.

What DNS server does 'home' use to resolve?
 
Old 07-21-2014, 03:31 AM   #11
johnmaxwell
LQ Newbie
 
Registered: Feb 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
The solution

As i knew very little as a newbie, the domain that i want to find it globally, have to registered, the private domain that i made will not be found globally.

OR
http://serverfault.com/questions/422...ps-not-working go to this link and at the end of the page there is some changes you want to make, the ISP should so that for you.

The settings all of them are fine.

Thanks to all for answering my silly question.

Last edited by johnmaxwell; 07-21-2014 at 07:21 AM.
 
Old 07-21-2014, 10:13 AM   #12
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
That was where I was headed. IP addresses don't get resolved to domains automatically. You need to register them, and have a DNS server or service that sends updated information to the root servers for dissemination.

If you want, you can use local DNS servers to handle the name resolution. They don't need to send out to the world's DNS servers. You can also use host file resolution if you don't want to deal with that much trouble for a small number of hosts or domains. Just update /etc/hosts in Linux and the equivalent C:\Windows\System32\Drivers\etc\hosts file in Windows.

Last edited by GaWdLy; 07-21-2014 at 10:18 AM.
 
  


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
DNS is not resolving. luckncool Red Hat 10 02-05-2014 12:01 AM
DNS Resolving kaitech76 Linux - Networking 14 04-08-2009 03:59 PM
DNS Resolving sarukie Linux - Networking 1 11-22-2004 11:41 AM
/etc/hosts resolving before DNS resolving ? markraem Linux - Networking 4 11-02-2003 05:54 AM
DNS not resolving ElementNine Linux - Networking 5 09-30-2003 07:42 AM


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