LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-28-2020, 03:51 PM   #1
Shamulonga
LQ Newbie
 
Registered: Apr 2020
Posts: 2

Rep: Reputation: Disabled
listen-on syntax error in bash


I tried to run the following command after editing named.conf file :
$ listen-on { 127.0.0.1; 192.168.100.6; };

It returned the following error message:
-bash: syntax error near unexpected token `}'

Can anyone help resolve this error?

Thank you
 
Old 04-28-2020, 04:24 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Welcome to LQ,

I can't find a listen-on command anywhere.

Have you tried to modify the syntax?

It's complaining about the area near the close bracket.

Have you tried removing the semicolon at the end of it all? Or the semicolon after the last IP address?
 
1 members found this post helpful.
Old 04-28-2020, 04:37 PM   #3
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: RHEL, Ubuntu
Posts: 212
Blog Entries: 1

Rep: Reputation: 82
What do you get from
Code:
named-checkconf
 
1 members found this post helpful.
Old 04-29-2020, 04:20 AM   #4
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by Shamulonga View Post
I tried to run the following command after editing named.conf file :
$ listen-on { 127.0.0.1; 192.168.100.6; };

It returned the following error message:
-bash: syntax error near unexpected token `}'
Escape both {} chars, as well as the ; ones with a backslash, they are special to the shell. So
Code:
 $ listen-on \{ 127.0.0.1\; 192.168.100.6\; \};
BTW: the last ; isn't needed, you are already at the end of the line.
But the previous ones would break your single command into multiple ones, so that the last } becomes a command of its own.
 
2 members found this post helpful.
  


Reply



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
httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 iswarya Linux - Newbie 1 01-25-2012 01:28 PM
[SOLVED] "Error: syntax before '@' token and Error: syntax at 'OTHER' token" bullrider Programming 2 07-27-2009 08:00 AM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
apache security for intranet: "listen 80" vs. "listen 127.0.0.1:80" pulper Linux - Software 3 09-27-2006 06:24 AM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM

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

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