View previous topic :: View next topic |
Author |
Message |
JimG n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/6333071153fab0fcd4dcc8.gif)
Joined: 14 Sep 2003 Posts: 19
|
Posted: Sat Mar 04, 2006 4:11 pm Post subject: Djdns |
|
|
Hello,
I have just setup DJDNS on my linux box for DNS caching. All is working well but I wanted to set it up so it resolves the linux boxes name to its IP address.
So my linux box's name is slacker.net however when I do a dig on slacker.net I am getting someone elses IP address (The real slacker.net on the internet) I would like it to resolve to my box 192.168.1.100.
I hope the goal of this makes sense please let me know if I can provide any other information..
Thanks! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Monkeh Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/158504026146c5220a4feda.png)
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Sat Mar 04, 2006 4:12 pm Post subject: |
|
|
Add it to /etc/hosts? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
JimG n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/6333071153fab0fcd4dcc8.gif)
Joined: 14 Sep 2003 Posts: 19
|
Posted: Sat Mar 04, 2006 4:22 pm Post subject: |
|
|
but /etc/hosts doesn't get used right?
resolv.conf is
Code: |
search houston.rr.com
domain net
nameserver 192.168.1.100
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Monkeh Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/158504026146c5220a4feda.png)
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Sat Mar 04, 2006 4:30 pm Post subject: |
|
|
.. /etc/hosts always gets used. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
JimG n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/6333071153fab0fcd4dcc8.gif)
Joined: 14 Sep 2003 Posts: 19
|
Posted: Sat Mar 04, 2006 4:38 pm Post subject: |
|
|
OK I appreciate you time.
So this is my /etc/hosts file
Code: |
# /etc/hosts: This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $
#
127.0.0.1 localhost
192.168.1.100 slacker.net slacker
# IPV6 versions of localhost and co
::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
|
So when I do a dig I would expect it to resolve to 192.168.1.100. However as the results below show it is getting the real slacker.net
Code: |
jim@slacker ~ $ dig slacker.net
; <<>> DiG 9.3.2 <<>> slacker.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52244
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;slacker.net. IN A
;; ANSWER SECTION:
slacker.net. 300 IN A 216.66.255.107
;; Query time: 1278 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Sat Mar 4 10:35:49 2006
;; MSG SIZE rcvd: 45
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Monkeh Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/158504026146c5220a4feda.png)
Joined: 06 Aug 2005 Posts: 1656 Location: England
|
Posted: Sat Mar 04, 2006 4:42 pm Post subject: |
|
|
Because dig is querying a DNS server directly. If you put that into the /etc/hosts of the machine you're using and try to go there in your browser, it should go to 192.168.1.100. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
JimG n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/6333071153fab0fcd4dcc8.gif)
Joined: 14 Sep 2003 Posts: 19
|
Posted: Sat Mar 04, 2006 4:56 pm Post subject: |
|
|
Yes you are right. I was making things more difficult than they needed to be... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|