LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-07-2021, 04:26 AM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Lightbulb DNS Bind


hello guys, followed this link to install DNS. https://www.unixmen.com/setting-dns-server-centos-7/

If need to add static entry to DNS just need to add items here:

vi /var/named/forward.dnsweblocal

And adding entry, like this data below will be ok?

localhost A 127.0.0.1

www.local-website.com A 127.0.0.1

www.other-local-website.com CNAME fake-hostname.com.


Thanks, for any help.
 
Old 07-07-2021, 04:37 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by JJJCR View Post
hello guys, followed this link to install DNS. https://www.unixmen.com/setting-dns-server-centos-7/

If need to add static entry to DNS just need to add items here:

vi /var/named/forward.dnsweblocal

And adding entry, like this data below will be ok?

localhost A 127.0.0.1

www.local-website.com A 127.0.0.1

www.other-local-website.com CNAME fake-hostname.com.


Thanks, for any help.
Yes, but you also need to increase the serial number and reload the zone.
 
1 members found this post helpful.
Old 07-07-2021, 10:50 AM   #3
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
You need to include the file forward.dnsweblocal as a zone, using the examples given then restart named/bind.
 
1 members found this post helpful.
Old 07-07-2021, 01:40 PM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Quote:
Originally Posted by bathory View Post
Yes, but you also need to increase the serial number and reload the zone.
Hi Bathory, thanks for the input.

The serial number has to be increase manually? Every time a new entry is added?
 
Old 07-07-2021, 01:41 PM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Quote:
Originally Posted by elgrandeperro View Post
You need to include the file forward.dnsweblocal as a zone, using the examples given then restart named/bind.
Thanks, Cheers!
 
Old 07-07-2021, 04:17 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by JJJCR View Post
Hi Bathory, thanks for the input.

The serial number has to be increase manually? Every time a new entry is added?
If you're editing the zonefile by hand, then you need to do it manually. If you're using a gui tool it's done automatically

BTW you also need to pay attention at the trailing dots in hostnames, because the lack of them makes zonename to be added at the hostname. So in your OP the 3 records are actually: localhost.local-website.com, www.local-website.com.local-website.com and www.other-local-website.com.local-website.com.
It should look like:
Code:
localhost. A 127.0.0.1

www.local-website.com. A 127.0.0.1

www.other-local-website.com. CNAME fake-hostname.com.
 
1 members found this post helpful.
Old 07-09-2021, 03:43 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
need your help again guys, i manually add the DNS to one of my laptop.

I'm able to do an nslookup hostname.xyz.local, and able to resolve the IP Address correctly.

I added an entry to the DNS as:

hostname.xyz.local. IN A 192.168.1.11

The host or the IP above is hosting a web locally.

I'm able to access it via: http://192.168.1.11/login/#/users


How to add a DNS entry to this?

I tried inputting in the browser as: http://hostname.xyz.local/login/#/users

But it just shows "no internet" in chrome

Any input on this guys on how to resolve?

Thank you.

Last edited by JJJCR; 07-09-2021 at 04:12 AM. Reason: edit
 
Old 07-09-2021, 07:03 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
How to add a DNS entry to this?

I tried inputting in the browser as: http://hostname.xyz.local/login/#/users

But it just shows "no internet" in chrome

Any input on this guys on how to resolve?
You said you added that entry in your dns!

If you're trying to access http://hostname.xyz.local/login/#/users from a different computer, make sure that it also uses your dns server as a resolver.
Run "dig hostname.xyz.local" from the client and see what you get.
 
1 members found this post helpful.
Old 07-12-2021, 09:35 PM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Thanks, Bathory.

The URL entry was changed to: http://hostname.xyz.local/login/r/users

Yes, it seems to work now. I think just need to add entry for Google DNS in named.conf, so if the item is not local then will go directly to external DNS.

Is this safe? Or what should be the good approach?

Thanks again.
 
Old 07-13-2021, 01:25 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by JJJCR View Post
Thanks, Bathory.

The URL entry was changed to: http://hostname.xyz.local/login/r/users

Yes, it seems to work now. I think just need to add entry for Google DNS in named.conf, so if the item is not local then will go directly to external DNS.

Is this safe? Or what should be the good approach?

Thanks again.
You don't need a third party resolver. The local nameserver that is authoritative for your zone(s), can also resolve external domains.
Perhaps google dns is faster, but on the other hand, I guess it uses your lookups for ads and such.

Regards
 
1 members found this post helpful.
  


Reply

Tags
dns



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about BIND and windows DNS compatibility, enabling scavenging on Windows DNS simon@tpmcomm.com Linux - Server 0 08-24-2012 11:22 AM
BIND - reverse dns queries only working locally, forward dns works fine. SloS13 Linux - Networking 3 08-25-2011 12:46 PM
Bind.DNS Help needed on Split DNS server manya Linux - Server 3 10-28-2010 08:39 AM
How to get Windows Clients to be served DNS from a Linux BIND-DNS Server texmansru47 Linux - Networking 12 07-10-2008 07:06 PM
LXer: DNS: The Bind Leading the Bind LXer Syndicated Linux News 0 06-15-2006 10:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration