LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can I set a single word to be an FQDN? (https://www.linuxquestions.org/questions/linux-newbie-8/can-i-set-a-single-word-to-be-an-fqdn-680735/)

hsia 11-02-2008 09:31 PM

Can I set a single word to be an FQDN?
 
I've set an FQDN for an IP address using BIND like suzie.example.com, but I feel that suzie.example.com is too long. I think that it's better if I can set a single word like suzie to be an FQDN. Thanks for helping.

MS3FGX 11-02-2008 10:21 PM

Then that would just be a hostname. The FQDN is an extension of the single-word hostname to make it unique. In other words, server1.example.com would be different than server1.test.com.

But if you are just using this name server on a local network, you can refer to the host with just the hostname, assuming the machine you are on is correctly configured to search that domain.

chrism01 11-02-2008 11:33 PM

Yeah, in the conf file you can declare a CNAME rec that points 'suzie' to suzie.example.com.
That's how everybody does it.
Good example here: http://www.linuxtopia.org/online_boo...bind-zone.html

hsia 11-02-2008 11:36 PM

Dear, Mr. MS3FGX

Thank you for helping me. I am using this name server on a local network, but the network is too large to set the host file one by one. Can I set this on DNS server?

chrism01 11-02-2008 11:42 PM

That link I gave shows you how to set it in a zone file in DNS, either as an A rec or possibly a CNAME.

hsia 11-03-2008 04:11 AM

Dear Mr Chrism01,

Thanks for helping me. I've tried the link you show me, but I can't make it worked. If I omitted the zone name in named.conf, named fails to start. If I use $ORIGIN example.com., IN NS suzie, and suzie IN A 192.168.1.2., nothing's happen. host suzie.example.com, I get "suzie.example.com has address 192.168.1.2." and host suzie, I get"Host suzie not found:3 (NXDOMAIN)". Actually, I am new in computer thing. Can you help me any further?

billymayday 11-03-2008 04:25 AM

Have a look in /etc/resolv.conf

You may want to add

search example.com

to get suzie treated as suzie.example.com

hsia 11-03-2008 09:18 PM

Dear Mr. BillyMayDay,

Thanks for helping me, now my server can locate suzie, but I can't ping suzie from my client. I can only ping suzie.example.com. Please help me.

chrism01 11-03-2008 11:00 PM

When you change the entries in the zone file, you need to increase the value of the number in the 'serial' field, usually by '1', so that bind/DNS knows it needs to re-broadcast that info to all systems.
That can take a little while. I think (?) if you reboot DNS on that system after you've fixed the file (ie set the recs correctly, increment the serial), that will force a re-broadcast.
See section '16.3.3. Example Zone File' in that doc I linked to.
Actually, prob a good idea if you post your file here.

hsia 11-04-2008 02:38 AM

Dear Mr. Chrism01,

Thanks again, here is my zone file:

$TTL 86400
@ IN SOA suzie.example.com. root.example.com. (
2008102435 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ) ; minimum TTL of 1 day
IN NS suzie.example.com.
IN MX 10 mail.example.com.
suzie IN A 192.168.1.2
mail IN A 192.168.1.2

I've tried to add $ORIGIN example.com., change every suzie.example.com. to suzie., add serial number by one, and restart named. I've tried to do the same in 1.168.192.in-addr.arpa.zone. But nothing happened.
I've tried to add suzie IN CNAME suzie.example.com, too. But named failed to start.
Please help me.

chrism01 11-04-2008 06:20 PM

What about the last section (in 16.3.3) about needing a matching zone entry in named.conf like this
Code:

This zone file would be called into service with a zone statement in the named.conf similar to the following:

zone "example.com" IN {
        type master;
        file "example.com.zone";
        allow-update { none; };
};

Also, i think you need the ORIGIN entry as well.
Unfortunately, everything I know about DNS I got from that article, so if any DNS gurus want to jump in, feel free
:)

hsia 11-05-2008 02:02 AM

Dear Mr.Chrism01,

Here ini my zone statement in named.conf:
zone "example.com" {type master; file "example.com.zone"; allow-update {key "rndckey";}; notify yes;};

If you see any clue to help me, please tell. By the way, Thank you for helping me this far. I really appreciate it.


All times are GMT -5. The time now is 08:07 AM.