LinuxQuestions.org
Review your favorite Linux distribution.
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 12-26-2005, 02:28 PM   #1
rubenscript
LQ Newbie
 
Registered: Dec 2005
Location: Romania
Distribution: CentOS 6 (2.6.32-279.el6.x86_64)
Posts: 18

Rep: Reputation: 0
My box is not resolving dns names. Waht can i do ?


Hi.

It's been a month since i'm trying to make the Internet work on my linux computer.
The scenatrio is:

1. I'm connecting to the internet throught a NAT Firewall/Router (running linux). I have no problem connecting to the internet from Windows.

2. My IP is assigned by DHCP

3. In linux i can ping yahoo's IP (for example), but dig, host, nslookup returns: "no servers could be reached".

My ip is: 192.168.0.78

/etc/resolv.conf looks like:

# begin resolv.conf
search signetnetwork.ro
xx.xx.xx.xx
xx.xx.xx.xx
xx.xx.xx.xx
# end resolve.conf

I have installed FC2, FC3, FC4, RH9 and now i have RH EL 4 AS 2 (2.6.9-22 EL) and none of them worked.

Please help me ...
 
Old 12-26-2005, 03:30 PM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
Well, for starters, try removing the search line of resolv.conf, it will cause weird problems like firefox quicksearch not working. Secondly, do the ip:s in resolv.conf match to the ones your windows boxen get as the DNS servers? Can you ping the DNS servers? Do you have an iptables firewall in place?

As a last resort, try reconnecting after the machine has booted up, its possible that theres something screwy with your NIC so that init doesn't do things right on the girst time (it happens, rare tho).. So, just do a rc.inet1 restart or whatever init system RHEL uses.. (:
 
Old 12-26-2005, 03:35 PM   #3
thompson42
LQ Newbie
 
Registered: Dec 2005
Location: Connecticut, USA
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
In /etc/resolv.conf, confirm that the IP addresses of your DNS servers are shown with the prefix "nameserver":

search signetnetwork.ro
nameserver xx.xx.xx.xx
nameserver xx.xx.xx.xx
nameserver xx.xx.xx.xx
 
Old 12-26-2005, 03:51 PM   #4
rubenscript
LQ Newbie
 
Registered: Dec 2005
Location: Romania
Distribution: CentOS 6 (2.6.32-279.el6.x86_64)
Posts: 18

Original Poster
Rep: Reputation: 0
i'm sorry ... i was on windows while i wrote the post in the forum (guess why - the net on linux is not working ) so i didn't remember the resolv.conf the correct file is:

search signetnetwork.ro
nameserver xx.xx.xx.xx

and so on.

I tried to remove the search line ... but no use.

And for Artanicus: Yes, i can ping the dns servers and other server .... but when i try to ping a name such as google or yahoo it's just not working.
 
Old 12-26-2005, 04:04 PM   #5
thompson42
LQ Newbie
 
Registered: Dec 2005
Location: Connecticut, USA
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
Can you contact your nameservers directly?

% nslookup ping.symantec.com xx.xx.xx.xx
Server: xx.xx.xx.xx
Address: xx.xx.xx.xx#53

Non-authoritative answer:
Name: ping.symantec.com
Address: 206.204.18.22


Does /etc/nsswitch.conf contain a line like this?

hosts: files dns


And as artanicus insightfully asked, do you have iptables running?
 
Old 12-26-2005, 04:09 PM   #6
rubenscript
LQ Newbie
 
Registered: Dec 2005
Location: Romania
Distribution: CentOS 6 (2.6.32-279.el6.x86_64)
Posts: 18

Original Poster
Rep: Reputation: 0
No, i cannot contact the NAMEserver like nslookup symantec.com xx.xx.xx.xx

I'm not sure about iptables. ... how do i turn them on ?
I don't know if the're running... how do i find out ?
 
Old 12-26-2005, 04:23 PM   #7
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
If you have any kind of local firewall solution (RHEL surely has some fancy interface for one) then it might be badly configured and blocking your DNS queries. So, try shutting down anything like that so we can narrow down the problem.

Also crossreferencing to a windows installation might prove useful, most differences in states on working / not working are actually caused by a different environment.. (;
 
Old 12-26-2005, 04:33 PM   #8
thompson42
LQ Newbie
 
Registered: Dec 2005
Location: Connecticut, USA
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
As root, type

iptables -L

to see if iptables is running. If it is running, and you get anything more than three lines ending in ACCEPT, then you'll want to examine the filtering rules you are using to see if they are causing you a problem. However, if you didn't set up iptables, it probably isn't running by default.

As artanicus said, did you confirm that you are using the same nameserver IP addresses as you use successfully on your Windows computer? No typos, right?
 
Old 12-27-2005, 02:37 AM   #9
rubenscript
LQ Newbie
 
Registered: Dec 2005
Location: Romania
Distribution: CentOS 6 (2.6.32-279.el6.x86_64)
Posts: 18

Original Poster
Rep: Reputation: 0
I confirm that my nameservers are correctly written in the resolv.conf.
I disabled SELinux and Linux Firewall.
 
Old 12-27-2005, 07:41 AM   #10
tuxuser19
Member
 
Registered: Oct 2005
Posts: 67

Rep: Reputation: 15
Try using static IP's it will work. I had the same issue with DNS. It worked straight away.
 
Old 12-27-2005, 07:52 AM   #11
thompson42
LQ Newbie
 
Registered: Dec 2005
Location: Connecticut, USA
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
With the firewall disabled, what response do you get from

nslookup ping.symantec.com xx.xx.xx.xx

Does anything appear in /var/log/messages as a result of running that command?

Does /etc/nsswitch.conf contain a line like this?

hosts: files dns
 
Old 12-27-2005, 09:43 AM   #12
rubenscript
LQ Newbie
 
Registered: Dec 2005
Location: Romania
Distribution: CentOS 6 (2.6.32-279.el6.x86_64)
Posts: 18

Original Poster
Rep: Reputation: 0
When i start iptables from the Services Interface it says:
iptables failed. The error was: Flushing firewall rules: [OK]
Setting chains to policy ACCEPT: filter [OK]
Unloading iptables modules [OK]

And that's all. Iptables is stopped.


In /etc/nsswitch.conf i found the line
#----
hosts: dns
#----

When i write iptables -L it says:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


And when i'm doing host ping.symantec.com 81.196.168.2 it says:

;; connection timed out; no servers could be reached

As well for nslookup ping.symantec.com 81.196.168.2 it says:

;; connection timed out; no servers could be reached


If the cause is iptables, what rules do i have to write ?
 
Old 12-27-2005, 01:26 PM   #13
thompson42
LQ Newbie
 
Registered: Dec 2005
Location: Connecticut, USA
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
The iptables output you show, with the three lines ending in ACCEPT, shows that no filtering rules are active, and all traffic can pass in and out freely. So I would think that iptables is not part of the problem at the moment. I'm not familiar with SELinux configuration, so I don't know what has to be opened up or shut down in SELinux to allow a basic network to work.

You said that you can ping hosts on the internet by IP address, yes? "ping 81.196.168.2" works? If you can do that, your basic networking setup is correct. I'd have thought that that was sufficient to get DNS queries via nslookup to work.

Artanicus' suggestion about something blocking your DNS queries sounds more and more likely.

Are there any entries in /var/log/messages that look pertinent to this problem?
 
Old 12-28-2005, 03:32 AM   #14
rubenscript
LQ Newbie
 
Registered: Dec 2005
Location: Romania
Distribution: CentOS 6 (2.6.32-279.el6.x86_64)
Posts: 18

Original Poster
Rep: Reputation: 0
/var/log/messages does not contain suspicious lines

Last edited by rubenscript; 12-28-2005 at 03:42 AM.
 
Old 12-28-2005, 07:43 AM   #15
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
So you got it fixed or not? The email alert kinda shows that you got it fixed, but you mustve edited the message after that.. /:
 
  


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
resolving names through a router Y0jiMb0 Linux - Networking 4 11-15-2005 04:05 PM
Web browser not resolving names Gavin Linux - Networking 7 04-16-2004 12:00 AM
NetBIOS names not resolving Xhalman Linux - Networking 0 02-16-2004 02:38 PM
/etc/hosts resolving before DNS resolving ? markraem Linux - Networking 4 11-02-2003 04:54 AM
Apache is resolving names to ip? danimaldaisy Linux - Networking 3 12-18-2002 12:54 AM

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

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