Click to See Complete Forum and Search --> : dumb question


hwb0014
10-19-2002, 02:51 PM
this may seem like a dumb question but i have to ask

i just recently configured bind 8 for redhat 8
i added hosts to my bind configuration but it seems that i cannot ping using the hostname that i added

ex

hostname.domain.cxm

ping hostname
hostname not found

this is what i get, but i can use nslookup from my client machines(windows 2000 machines)

i did manually edit my host file and then i was able to ping, but doesnt dns do that automatically? what do i have to do besides manually editing my host file to get the host file to automatically get in synch so i dont have to manually do this every time there is a change or a new computer in the domain

cowanrl
10-19-2002, 03:21 PM
You should be able to do ping hostname.mydomain.com.

To be able to do ping hostname, you need to have your computer set up properly. In Linux, you need to have your domain set in the /etc/resolv.conf file. The file should look something like:

domain mydomain.com
nameserver x.x.x.x (IP address of DNS server)

You may also want to add:

search mydomain.com

but it shouldn't be necessary.

With that set up properly, when you execute:

ping hostname

it will append mydomain.com to the hostname before it sends the request to the DNS server.

In Windows, you need to set your hostname, domain name and DNS server address on the TCP/IP properties pages. I think sometimes you need to click on the Advanced button to get to it.

Of course, if you are running a DHCP server, you can set it up to provide that info to your workstations. (I don't believe Windows will take it's hostname from DHCP though).

Once you get that set up, you won't need anything in your /etc/hosts file except the

127.0.0.1 localhost

You always want to leave that there.

hwb0014
10-19-2002, 03:50 PM
when i run dig command
i dont get an answer when i run this with the hostname

[root@david etc]# dig gina

; <<>> DiG 9.2.1 <<>> gina
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 25153
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;gina. IN A

;; AUTHORITY SECTION:
. 10800 IN SOA A.ROOT-SERVERS.NET. NSTLD.VERISIGN-GRS.COM. 2002101900 1800 900 604800 86400

;; Query time: 269 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Sat Oct 19 15:47:18 2002
;; MSG SIZE rcvd: 97


gina being a host
my resolv.conf is configured correctly i believe

i only get a true answer when i run the dig command hostname.domainname.com

how can i get it where i only have to type
dig gina

and receive the same results

thanks again

cowanrl
10-19-2002, 06:25 PM
According to the dig man page, it does not append what you have on the search line in /etc/resolv.conf. You have to use the +search option with the dig command.

For me

ping hostname

works just fine.

dig hostname

doesn't get a name resolution.

dig hostname.domainname
or
dig +search hostname

return a name resolution.

You may be able to configure some kind of alias on your DNS server so you can dig with just a hostname but I'm not familiar with how to do it.

hwb0014
10-19-2002, 06:28 PM
thanks

cowanrl
10-19-2002, 07:26 PM
You're welcome.