Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Djdns
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
JimG
n00b
n00b


Joined: 14 Sep 2003
Posts: 19

PostPosted: Sat Mar 04, 2006 4:11 pm    Post subject: Djdns Reply with quote

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
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Sat Mar 04, 2006 4:12 pm    Post subject: Reply with quote

Add it to /etc/hosts?
Back to top
View user's profile Send private message
JimG
n00b
n00b


Joined: 14 Sep 2003
Posts: 19

PostPosted: Sat Mar 04, 2006 4:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Sat Mar 04, 2006 4:30 pm    Post subject: Reply with quote

.. /etc/hosts always gets used.
Back to top
View user's profile Send private message
JimG
n00b
n00b


Joined: 14 Sep 2003
Posts: 19

PostPosted: Sat Mar 04, 2006 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Sat Mar 04, 2006 4:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
JimG
n00b
n00b


Joined: 14 Sep 2003
Posts: 19

PostPosted: Sat Mar 04, 2006 4:56 pm    Post subject: Reply with quote

Yes you are right. I was making things more difficult than they needed to be...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum