LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   host issue to resolve itself (https://www.linuxquestions.org/questions/linux-newbie-8/host-issue-to-resolve-itself-863339/)

karlochacon 02-17-2011 10:23 AM

host issue to resolve itself
 
hi guys

I have standalone Suse 10 SP3 that when I run
Code:

# hostname
webserver

but when I run host command
Code:

# host webserver
;; connection timed out; no servers could be reached

I would like to get the IP when I issue
Code:

host webserver
x.x.x.x

and the name when
Code:

host x.x.x.x
webserver

in /etc/hosts I have
Code:

x.x.x.x  webserver
in /etc/HOSTNAME
Code:

webserver
I don't know what to put in /etc/resolv.conf


any idea how to make to resolve to itself?

thanks a lot

acid_kewpie 02-17-2011 10:29 AM

the host command is for dns lookups only. it won't use data in /etc/hosts. so if you specifically want to resolve that data using dns then you'd need a dns server that contains that record, possibly dnsmasq. However other programs, e.g. ping use a stack as defined in /etc/nsswitch.conf to resolve names, not just dns, so maybe you're troubleshooting the wrong issue and there's no problem to addres in the first place.

karlochacon 02-17-2011 10:41 AM

but I really don't want to use DNS since it is not needed.

in that case hostname will check if the hostname is correct right?

valen_tino 02-17-2011 12:03 PM

hostname -i


All times are GMT -5. The time now is 10:01 AM.