LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   sites are not resolving (https://www.linuxquestions.org/questions/debian-26/sites-are-not-resolving-372713/)

anindyanuri 10-13-2005 02:13 PM

sites are not resolving
 
New to debian. Trying to use 3.1

This is my thrid attempt to this distro. Before previous 2 attempts I also felt the problem and lost interest after some days.

The problem for me is site names are not resolving. I am damn sure that /etc/resolv.conf contains necessary nameserver entry. Still, for better understanding, I am giving the entry of /etc/resolv.conf.
Code:

nameserver 202.138.103.100
nameserver 202.138.96.2
nameserver 202.138.103.100
nameserver 202.138.96.2

In my browser, if I put the ip address of the sites, it is opening, but if I put the name of the site it is not opening.
Example, http://www.google.com is not opening the site, but 66.249.89.104 is opening the site.

what is the problem?

please help

regrds
anindyanuri

Mega Man X 10-13-2005 02:38 PM

I had a very similar problem with Solaris once. You might want to check my thread in the case it also helps you:

http://www.linuxquestions.org/questi...hreadid=366690

Best of luck!

MensaWater 10-13-2005 02:39 PM

You're leaving out the search domains. This means you have to specify the FQDN for the items for which you wish to search.

Example. If you have a sever with FQDN (Fully Qualified Domain Name) of myserver.mydomain.com then you have to type all that in.

With a search list that specifies mydomain.com you would only have to type in "myserver".

/etc/resolv.conf should specify both search and nameservers - Example:

search mydomain.com mydomain.net dmz.mydomain.com
nameserver 202.138.103.100
nameserver 202.138.96.2
nameserver 202.138.103.100
nameserver 202.138.96.2

The above example would find any host in mydomain.com, mydomain.net or dmz.mydomain.com so long as the above nameservers had the corresponding zone files for these. If you searched for "myserver" it would first try to find myserver.mydomain.com and failing that would try myserver.mydomain.net and finally would try myserver.dmz.mydomain.com.

anindyanuri 10-13-2005 02:45 PM

Oooff............I am not able to follow the thread.

Thank you Megaman for help but i am not able to follow the thread, getting message "Please check the name and try again."

I reached www.linuxquestions.org by its ip address 64.179.4.149
But then there was no problem to follow the 'Forum' link and others to reach here..........but cannot tell you, now I am not able to follow your recommended thread. Hope moderators may give us some light....

please help me........i am sucked

regrds
anindyanuri

Mega Man X 10-13-2005 02:55 PM

Hi again anindyanuri!.

That's quite a situation :). I will do a copy/past job here for the relevant parts of that thread:

----------------------------------------

Problem: I am not able to connect outside my LAN, or even ping any other sites:

created /etc/resolv.conf:

I've added my Primary and secondary DNS given by my ISP in two separated lines.

edited /etc/nsswitch.conf

I made sure that the line "hosts: files dns" was in there.

netstat -rn | grep default returns the following:

default 192.168.2.1 UG 0 0

192.168.2.1 is my routers/firewall IP. I also tried to create a file called /etc/defaultrouter and put that number in there

Quote:

by jlliagre
So the problem is not routing but naming, DNS are not properly configured.

Double check:
/etc/resolv.conf
/etc/nsswitch.conf

Possibly, kill and restart /usr/sbin/nscd

run "nslookup www.linuxquestions.org" and see what it says.


Basically, check the files I've checked, especially the ones suggested by jlliagre and see if they exist. I'm not quite sure if Debian works in the same way (and for coincidence, I'm also using Debian, but it worked out of the box for me, as well as newer Solaris)

Good luck!

anindyanuri 10-13-2005 03:15 PM

Quote:

Originally posted by jlightner
You're leaving out the search domains. This means you have to specify the FQDN for the items for which you wish to search.

Example. If you have a sever with FQDN (Fully Qualified Domain Name) of myserver.mydomain.com then you have to type all that in.

With a search list that specifies mydomain.com you would only have to type in "myserver".

/etc/resolv.conf should specify both search and nameservers - Example:

search mydomain.com mydomain.net dmz.mydomain.com
nameserver 202.138.103.100
nameserver 202.138.96.2
nameserver 202.138.103.100
nameserver 202.138.96.2

The above example would find any host in mydomain.com, mydomain.net or dmz.mydomain.com so long as the above nameservers had the corresponding zone files for these. If you searched for "myserver" it would first try to find myserver.mydomain.com and failing that would try myserver.mydomain.net and finally would try myserver.dmz.mydomain.com.

I tried according to your suggestion, with `search 127.0.0.1' in the /etc/resolv.conf but it did not help me. Waiting....


regards
anindyanuri

MensaWater 10-13-2005 03:45 PM

In the search statement you do NOT specify a SERVER - you specify a DOMAIN. In the nameserver line you specify SERVERS.

SERVER EXAMPLES (note these are IP addresses for SERVERS):
127.0.0.1
202.138.103.100
202.138.96.2
202.138.103.100
202.138.96.2

DOMAIN EXAMPLES:
mydomain.com
google.com
yahoo.com
comcast.net

Your DOMAIN is what follows the "@" after your name in your email address. Example: billybob@gmail.com has a name of "billybob" and a domain of "gmail.com".

Please reread what I wrote earlier - you do NOT see me specifying a server in the search string. What you are seeing are made up domain names. You should specify the correct domain name for your environment rather than the ones I listed.

anindyanuri 10-13-2005 10:49 PM

Quote:

Originally posted by jlightner
In the search statement you do NOT specify a SERVER - you specify a DOMAIN. In the nameserver line you specify SERVERS.

SERVER EXAMPLES (note these are IP addresses for SERVERS):
127.0.0.1
202.138.103.100
202.138.96.2
202.138.103.100
202.138.96.2

DOMAIN EXAMPLES:
mydomain.com
google.com
yahoo.com
comcast.net

Your DOMAIN is what follows the "@" after your name in your email address. Example: billybob@gmail.com has a name of "billybob" and a domain of "gmail.com".

Please reread what I wrote earlier - you do NOT see me specifying a server in the search string. What you are seeing are made up domain names. You should specify the correct domain name for your environment rather than the ones I listed.

jlightner, I am not running any webserver from my computer. You may treat it a complete desktop for my learning (Linux). I have gone through your messages and as far as I have understood, I need a Fully qualified domain name as the search string. As there is no Fully qualified domain name for my computer, what should I do in this case? I log into my computer as `anindyanuri@debian'
For more info, I am able to use network commands only as root, not from my hostname(=anindyanuri).
Code:

anindyanuri@debian:~$ host www.linuxquestions.org
;; connection timed out; no servers could be reached
anindyanuri@debian:~$ nslookup www.linuxquestions.org
;; connection timed out; no servers could be reached

anindyanuri@debian:~$ su
Password:
debian:/home/anindyanuri# host www.linuxquestions.org
www.linuxquestions.org has address 64.179.4.149
debian:/home/anindyanuri# nslookup linuxquestions.org
Server:        202.138.103.100
Address:        202.138.103.100#53

Non-authoritative answer:
Name:  linuxquestions.org
Address: 64.179.4.149

debian:/home/anindyanuri#

Entry to my /etc/hosts file...
Code:

127.0.0.1      localhost.localdomain  localhost      debian

# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Entry to my /etc/nsswitch.conf
Code:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:        compat
group:          compat
shadow:        compat

hosts:          files dns
networks:      files

protocols:      db files
services:      db files
ethers:        db files
rpc:            db files

netgroup:      nis

regrds
anindyanuri

MensaWater 10-14-2005 06:53 AM

Your examples make it appear your issue is simply one of permissions.

Do "ls -l /etc/resolv.conf" and make sure it has read permissions for everyone:
-rw-r--r-- 1 root root 84 Oct 13 16:19 /etc/resolv.conf

The "-rw-r--r--" means: Owner can r(ead) and w(rite), group can r(ead) and others can r(ead). If you're file does not have an "r" in the positions shown above then it isn't readable and that's your problem. You can make your file look like the above by typing:
"chmod 644 /etc/resolv.conf"

Also check /etc/hosts and /etc/nsswitch.conf permissions. They too should be read for owner, group and other.

The reason I believe it is a permissions issue is because from the examples you gave in your last post you show you can not get host or nslookup to work as user, anindyanuri but when you do "su" to root user it works. This means the issue is your user can not do it rather than it not working at all.

For now don't worry about FQDN or search strings as the examples you gave show your DNS name resolution IS working - the issue is just that it is only working for root at the moment.


All times are GMT -5. The time now is 05:05 PM.