PDA

View Full Version : pseudo hostnames


daviddoria
2007-12-26, 02:00 PM CST
I would like to have a handfull of names that will be accessible to the network that i can periodically change where the point

for example, i want one day
mailserver to point to 192.168.1.1
and the next day
mailserver to point to 192.168.1.2

I thought I could do this with a dns server, but it seems like overkill. I tried to use named, but I have had no success. I added a file in /var/named called named.MYDOMAIN, but i didn't see anywhere in /etc/named.conf to tell it to look at that file - all it has is "directory /var/named/"

the conents of named.MYDOMAIN are just

TESTNAME IN A 192.168.1.1

then i added the machine running named to another machine's DNS server list. When i ping TESTNAME i get nothing.

did i miss something major? or is there an easier way to accomplish what i want?

Thanks!

David

daviddoria
2008-01-02, 07:59 AM CST
any way to do this?
bump

udev_dean
2008-01-02, 12:30 PM CST
adding the PCs to your /etc/hosts won't work for you?

daviddoria
2008-01-02, 02:19 PM CST
no
i am trying to run a new mail server, but i want to leave the old mailserver running on a different machine so incase something breaks i can point all the clients to the old server by only chaning the dns entry instead of changing where every client is looking for mail

so i will have the clients setup to check mail at "mailserver"
then i will point mailserver either to the new one or the old one in the dns

make sense?

jrummy27
2008-01-02, 02:27 PM CST
Then you'd have to set up a dns server or change /etc/hosts on all the clients (probably not desirable). In your named.conf, you have to define a zone corresponding to your domain. This is where you would point it to the named.MYDOMAIN file you created. Check out the configuration examples at http://tldp.org/HOWTO/DNS-HOWTO.html.

Once you've set it up you'll need your clients to point to that dns server in /etc/resolv.conf. After that this should return the ip address of TESTNAME # nslookup TESTNAME

udev_dean
2008-01-02, 02:34 PM CST
Or probably an easier fix, since you rarely loose a server, is just to put the backup server as the downed servers IP. That'll take all of 2 seconds rather then fiddle with DNS records and getting it to populate changes to the clients. The clients could also have the IP as the mail server too so that you can totally stop playing with name resolution. Probably not what you're looking for but just a suggestion.

daviddoria
2008-01-02, 02:41 PM CST
good idea udev_dean , but i have other stuff running on the "backup" server too so i dont really want to do that.

jrummy27 - i just made a separate post about bind not working from windows, but i just ran

nslookup testentry
from the same box as the dns server and got

Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find testentry: NXDOMAIN

so maybe it isn't working on linux either? clearly i have something setup wrong - see this post: for my current config: http://forums.fedoraforum.org/showthread.php?t=177152

i'll take a look at that howto in the mean time.

Thanks,
David