LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-08-2017, 06:18 AM   #1
NobleOne
LQ Newbie
 
Registered: Jul 2017
Posts: 29

Rep: Reputation: Disabled
Setting Up Permanent DNS Routes


Still a newbie at configuring Linux. I have a new machine, installed Fedora Server 25, all ok. Trying to setup the static IP. I believe I have to setup the DNS routes, but not sure how. Can someone tell me if I am on the right track, and if so, how to setup the routes? The router shows the static IP correctly, and I can ping only those devices that are on the subnet.

NOTE: There is no GUI. I have to do this through the character interface.

Here is the content of /etc/sysconfig/network:

# Created by anaconda
NETWORKING=yes
HOSTNAME=jonas
NTPSERVERARGS=iburst


Here is the content of /etc/sysconfig/network-scripts/ifcfg-enp4s0
HWADDR=00:E0:4C:68:00:4B
TYPE=Ethernet
NM_CONTROLLED="yes"
BOOTPROTO=static
IPADDR=192.168.1.252
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
DEFROUTE=yes
PEERDNS=no
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp4s0
UUID=2be202a9-47e3-3f1b-9479-058fd1519a21
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999
 
Old 07-08-2017, 07:23 AM   #2
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
First of all, DNS has nothing to do with routing. That is handled by routers.

DNS is Domain Name Services

All DNS does is transform an Internet address like www.linuxquestions.org into an IP address so a connection can be sent out on the network.

Code:
| => dig www.linuxquestions.org

; <<>> DiG 9.9.7-P3 <<>> www.linuxquestions.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43856
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.linuxquestions.org.		IN	A

;; ANSWER SECTION:
www.linuxquestions.org.	93	IN	A	75.126.162.205

;; Query time: 35 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Jul 08 08:19:19 EDT 2017
;; MSG SIZE  rcvd: 67
It can also include information about mail servers, authoritative name servers, and several other things.

An ordinary user with a cable modem or DSL should not have to worry about routing.
 
Old 07-08-2017, 07:28 AM   #3
NobleOne
LQ Newbie
 
Registered: Jul 2017
Posts: 29

Original Poster
Rep: Reputation: Disabled
Ok, thanks, but I use port forwarding to get to a database on the server from locations outside of the local network. So, I have a static IP, but in establishing that, lost connectivity to the internet. Can you help me get that restored with the static IP?
 
Old 07-08-2017, 07:40 AM   #4
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by NobleOne View Post
Ok, thanks, but I use port forwarding to get to a database on the server from locations outside of the local network. So, I have a static IP, but in establishing that, lost connectivity to the internet. Can you help me get that restored with the static IP?
You obviously have a firewall running which mainly blocks incoming connections unless you specifically allow them.

I don't even know what kind of firewall you have, so I have to speak in generalities. If you want ssh and its friends to connect so you can connect to your computer from elsewhere, you'll want to punch a hole at port 22, 614, 830, 3897 and 1735, I'm not sure how important those higher numbers are, you might want to just start with 22. If you're running a webserver you want the world to have access to, you need to open port 80 (http) and 443 (https). You don't necessarily have to open a port to the whole world, you can open it to certain IP addresses.

If you want to see what ports different services use, look at /etc/services. They should all be there.

Last edited by Laserbeak; 07-08-2017 at 07:47 AM.
 
Old 07-08-2017, 07:43 AM   #5
NobleOne
LQ Newbie
 
Registered: Jul 2017
Posts: 29

Original Poster
Rep: Reputation: Disabled
Sorry, I wasn't clear enough. I was basically explaining why I need to establish the static IP. I know how to punch a hole in the firewall using firewalld. After adding the static IP, the server can only ping internal network nodes, not anything on the Internet. Knowing this, I expect that I have to fix this problem before going on to the firewall. Thanks in advance for any help you can provide.
 
Old 07-08-2017, 08:56 AM   #6
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by NobleOne View Post
Sorry, I wasn't clear enough. I was basically explaining why I need to establish the static IP. I know how to punch a hole in the firewall using firewalld. After adding the static IP, the server can only ping internal network nodes, not anything on the Internet. Knowing this, I expect that I have to fix this problem before going on to the firewall. Thanks in advance for any help you can provide.
Ping is based on ICMP, so if you see anything in the firewall settings make sure it's completely open, the Internet can act strange if ICMP is blocked.
 
Old 07-08-2017, 09:01 AM   #7
NobleOne
LQ Newbie
 
Registered: Jul 2017
Posts: 29

Original Poster
Rep: Reputation: Disabled
I solved it. I just had to add the Primary DNS and Secondary DNS to the ifcfg* file. I can ping the world now!
 
Old 07-08-2017, 09:03 AM   #8
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by NobleOne View Post
Ok, thanks, but I use port forwarding to get to a database on the server from locations outside of the local network. So, I have a static IP, but in establishing that, lost connectivity to the internet. Can you help me get that restored with the static IP?
Sorry, I kind of missed that. So you have no Internet connectivity at all? The firewall should be set to allow all outgoing traffic to anywhere.
 
Old 07-08-2017, 09:04 AM   #9
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Talking

Quote:
Originally Posted by NobleOne View Post
I solved it. I just had to add the Primary DNS and Secondary DNS to the ifcfg* file. I can ping the world now!
Cool
 
  


Reply

Tags
dns, fedora 25, server


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
permanent static routes on CentOS/Red Hat Enterprise Linux whistl Linux - Networking 4 03-24-2009 12:30 PM
Setting up the routes for pptp arsham Linux - Networking 4 10-25-2008 09:17 PM
Setting up Routes in FC7 diggs Fedora 3 06-24-2008 09:20 PM
debian - make routes permanent codeape Debian 2 02-14-2004 01:18 PM
how to set permanent routes? pioniere Linux - Networking 3 10-24-2003 03:45 PM

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

All times are GMT -5. The time now is 11:15 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